1. Overview

In last month publication I covered visual jforex strategy logic creation for creating and running strategy in demo account. It was just simple logic which allows opening of not more than 3 trades at a time and trying to benefit from small rate movements. But trading window and determination of trading window, i.e. finding of time when rate movements are really small was not covered and it is topic of present publication.

2. Determination of trade window principles

There are plenty of technical ways to determine trading window. One possibility is trying to analyze candles set different candle high or low targets and so on. Second possibility is to use various indicators and determine trading window based on these indicators values. As there is a lot of already existing indicators I decided this time try to use existing indicators by choosing their values for decisions when to open trading window and when to close it.

So firstly visual jforex logic should be organized so that during certain time it should run and during certain time not. For this purposed logic was split to two parts using Multiple Action block.


First output of Multiple Action block is directed to logic which determines are conditions in market for opening trading window or not and second branch is responsible for running of logic which make decisions to open trade or not.

Now about trading window opening principles. For determination of trading window conditions two indicators are used SMA and T3. SMA represents simple moving average and calculates arithmetical average of last 30 1 min candles. T3 moving average calculates last 5 1 min candles average based on advanced formula which is dedicated to quickly follow changes in rate values. So if T3 value is similar to SMA value it means that at the moment there is no big movements in the market. Otherwise quite big movements exists.

Therefore logic calculates difference between these two values with help of Calculation block and later on comparison is made if difference between these values is less than 5 pips variable trigger is set to 1.. This variable later is used in second logic branch and this branch operates only if trigger is equal to 1. Mentioned comparison is made every 1 min. and if T3 and SMA values runs out from 5 pips interval trigger is set to 0 second branch stops its operation and if there are any open trades such trades are closed at market price.


As could be seen from picture above second output of Multiple Action block after filtering of EUR/USD 1 min candles checks whether variable trigger is equal to 1 or less than 1 (used for triggering output when value is 0). In case trigger is 1 algorithm continues and check is made to open new trades or not (this logic is described in previous publication). In case trigger is equal to 0 by means of Position Viewer block check is made is there any positions or not and if any position exists it is closed at market prose with help of block Close and Cancel Position.
So mentioned amendments of strategy logic are made and now strategy could be loaded to demo platform.

3. Strategy loading to demo platform

For strategy loading to demo platform it is needed to copy source code from visual jforex platform and paste it to strategy editor in jforex demo platform.


In visual jforex platform right side of screen by clicking strategy icon drop down menu appears from which My Strategies icon could be clicked and all created strategies will appear. After that strategy of interest should be right clicked and separate window appears with strategy source code. This code could be copied and later on pasted to jforex demo platform.

In jforex demo platform by selecting Tools - Strategy editor strategy editor window appears.


To this window strategy source code should be copied and later on strategy compiled. After that strategy is ready for running and could be run after selecting Tools - Strategies and choosing strategy from Strategies list.



After choosing strategy is could be right clicked and running method local run or remote run chosen. I prefer running strategies remotely as in this case performance is not related to my computer functioning.



As can be seen from picture above present conditions in market are assumed as suitable for trading window to be open and 2 trades already opened.

4. Conclusions

So trading logic is amended and now trading should take place only in case set conditions in market are met. So now it is time to follow strategy performance and think of further development of strategy.
Translate to English Show original