I started trading not much like many other starters with fast cars and pretty chicks on mind. I started it as a Research & Development project with a sole purpose of having:
  • A documented accurate trading logic or process that suits my trading style. (Genetic representation & instructions).
  • A precise trading system that ensures: the repetition of accuracy for the above-mentioned process; and that the process is running in a controlled environment.
After having my Crystal Pyramid in place. (the name given to my strategy due to its pyramid-like structure, why crystal?, image-search for the whole term and you might know why).

Finally, it was deployment time. I needed a different broker than those I initially created my trading accounts for my R&D with. Currently, this R&D endeavor has self-financed itself with a proper Return-On-Investment too.

My requirements for that broker was (prioritized in descending order):

  1. Trust to be a business partner.
  2. Tier 2 liquidity provider (STP/ECN brokerage model.)
  3. A solid framework architecture that is seamlessly integrated, coherent, extensible and platform independent.
I had a list of the Top-10 for the above-mentioned requirements 1 & 2. Dukascopy was one of them. After narrowing down with requirement number 3. Dukascopy platform stood out for me (Note the puzzle image standing out used as the document master theme: it tells it all. I know you didn't either or).

I scheduled looking this platform under the hood and documenting it my way in July. Duka's called for themed article in April's, originally wasn't intending to publish this. I had an article series called "The Game-Changer" to start from April. I rescheduled: it's JFX's time.

The purpose of this document is to serve as a dual 60 minutes introductory guide to JFX platforms, to all JFX adopters at all levels.
It focus to be a learning accelerator, only supplementing JFX WIKI with a special emphasis on Visual JFX.

This document applies to :
  • Visual JFX Strategy Builder (demo:limited version)
  • JFX Strategy API

Being constrained with words limit, needed images to express much more. To make the most of this document, links to respective web-pages were used. Below, are their various types:





1: Introduction
This purpose of this section is to ensure common perception and understanding of the terms used throughout.

1.1: JAVA

While vast majority of trading platforms adopt a framework and build their own compiler (syntax or query language) over it. This has a steep learning curve and increases your dependency over it. The rest had chosen inappropriate function-specific platform, gaming for example as their own. JFX as the first letter "J" denotes, have chosen JAVA.


1.1.1: What is JAVA?



1.1.2: Where is JAVA?





1.1.3: Why JAVA?





1.2: API

APIs or Application Programming Interface is the magic keyword behind which most of today's online services stands.


1.2.1: What is an API?





1.2.2: Example of an API




1.2.3: Advantages of APIs





Keep this as a mental image of an API. (Below)




1.3: Process

A process is any activity that transforms inputs into outputs. The depiction of such using flow-charting is called Process Model. Trading is a process that will be closely examined.





2: Architecture and Trading

Now, let’s examine the well stacked and racked Dukascopy platforms architecture.

2.1: xJFX's Architecture

A high-level view of the architecture is shown below. The base is Dukasopy’s implementation of the FIX API. FIX or Financial Information eXchange is a communications protocol for real time communications between financial markets. Dukascopy FIX API is the implementation of it. Smartly selected and placed is the JAVA SE upon it.







2.2: The Trading Process

Trading is simply a process and like any other process it has its inputs and its outputs. Your trading strategy is the process. From now on, these two words will be used interchangeably.

2.2.1: Brainstorming Trading Activities

A typical output of traders’ brainstorming session on their trading activities. (Below)




2.2.2: Arrangement of Activities




2.3: xJFX's Functional Scope

The functional scope of Visual JFX and JFX Strategy API is shown below.The common elements will be referred to as xJFX covered in section 3. Note that unless your strategy uses Renkos, Range-Bars or P&F in its logic, Visual JFX can do it all.





Now, let us do some arrangements. (Below)




Now, let us do some arrangements. (Below)





3: xJFX Unleashed

Now, will examine thoroughly each element of the model.


3.0: Resources

Everything is built on the Trading System (IContext).




Login to Visual JFX doesn't mean access to the Context. (Below)




This is how you get the Context. (Below)




3.1: Inputs



3.1.1: Account Information (IAccount)

This is simply your account information.






An example would clarify things further. (Below)




Finally, a summary of the methods.




3.1.2: Market's History (IHistory)

This is simply the price action of the market. It provides the ticks and the candles (bars).





Accessing the last candle in Visual JFX is shown below.



Getting a historical candle(s) in Visual JFX is shown below.








Finally, a summary of the methods.




Now, let us examine the Tick and Candle structure.

3.1.2.1: Tick Structure (ITick)







3.1.2.2: Candle Structure (ICandle)









3.2: Outputs

Now, the outputs from the strategy.

3.2.1: Orders





3.2.1.1: Types of Orders









3.2.1.2: Orders' States

Now, the order states in the life-cycle of an order.







3.2.1.3: Orders' Flow

Now, let us see the order flow between the trader and the broker: the IEngine along with the agreed upon messaging communication. This is the generic flow.






3.2.1.4: Management










3.2.1.4.1: Order Commands

Let us dig deeper and examine the order commands enumeration.


'



3.2.1.4.2: Order Structure

Once an order is created, it will have the following structure:








3.2.2: Trader's Log (IConsole)

While there is no explicit way to print to the console in Visual JFX, apart from the orders' comments discussed previously. This is discussed here as it might be a limitation in the demo version.






The summary of the logging methods in JFX. (Below)




3.3: Process

After we examined the inputs to and outputs from the process. Now, it is the strategy time.

3.3.1: Variables' Scope

Visual JFX has the three variables' scope, just like JAVA. Visual JFX has an extra feature that is the auto-variables declaration for both the block and local scope variables.











3.3.2: Strategy Events

Trading itself is an event driven process, so strategies must be. Your trading logic is contained within events. Technically speaking, these events are synchronous call-back functions. Before, digging in, another re-arrangement.




3.3.2.1: Start and Stop Events

Everything has a beginning and has an end. The onStart & onClose are. Common uses are: initialization, allocation of resources, self-check test in multi-tiered strategies,memory management and garbage collection.




3.3.2.2: Trade Events

The trade event in Visual JFX contains the onAccount & onMessage events.




3.3.2.3: Logic Events

Finally, our trading logic is placed here: onTick and onBar events. Indicators is placed here for clarification purposes only. It is NOT an event.





3.4: Putting it ALL Together




4. CONCLUSIONS:
  • xJFX is beautifully stacked into a process model that NOT only makes it logical and hence easier to understand, it more importantly makes it more functional.
  • Visual JFX is the best strategy builder in the market, don't take my word for it,go surf the web and see yourself. I have a personal reason to love it. As you can see below, this is my way of depicting any flow, idea and even Support & Resistance levels. So personally, its the way the mind works. No wonder, they are called Mind Maps. Visual JFX is the trader's mind map.


  • Visual JFX does all the heavy-lifting for either newbies or advanced coders. The boiler-plate template it provides is much cleaner and possess error handling routines that the JFX template lacks.
  • Visual JFX can be easily extended at anytime. It currently being capped by a managerial or innovation management decision and not a functional or architectural constraint.
  • My humble opinion is that JFX API is a beautiful beast worth any time invested learning to tame it. This document is a proof that I did and presenting it to you for a faster learning curve.
  • This opinion is expressed in a real conversation (Below).




5. RECOMMENDATIONS:

  • Extending the Visual Strategy Builder to Indicator building too. This has couple of advantages:
  1. The blueprint of any strategy starts from visually mixing, matching and optimizing other indicators to calculate new values (new indicator). Then, this is converted to trading logic with entry & exit rules. This would assist all strategy builders in building much more effective strategies.
  2. Faster Strategy deployment time.
  3. Increase the number of available indicators available on the JStore. Stats show that the greater you have, the bigger is your market share.
  • Extend the role of this community to encompass product documentation with technical moderation. Dukats and community ranks (if created) can be a sufficient motive. Furthermore, it could be even extended to community to community & community to customer support in non-business hours by ranked members, hence providing an unrivaled 24/7 support. Dukascopy's support will do the rest of the follow-up to ensure effective closure. Everybody is a winner.

Translate to English Show original