Trading from the comfort of your home has never been more easier than it's today when you have brokers like Dukascopy that provides every trader with the right tools to succeed in this business and ultimately have an edge over others competitors. Many new traders believe that an automated strategy must incorporate some kind of indicators. Well, the truth is you don't actually need indicators to trade, and here comes my article to help you design your own automated strategy using Visual JForex. My last article EMA Crossover System Meets Visual JForex outlined an incredible simple step-by-step guide on how to create your own automated strategy using indicators. Also I strongly recommend you to get used with the Visual JForex interface by watching Dukascopy tutorials.

Unlike my previous article here I'm going to use new blocks and we are going a little bit deeper and make a strategy that's more challenging without using any indicators whatsoever. It's time for you to never have a cluttered chart again and if you believe in keeping things simple that this article is for you. Even if you don't have any programming skills whatsoever, don't be scared, this article is for you as well.

Lets proceed first by giving a short summary of our strategy:
  1. Currency pair: GBPUSD.
  2. Time Frame: Any (H1 is better)
  3. Trading Rules:
  • Find the HighestPrice and LowestPrice between 07:00AM(GMT+1) and 09:00AM(GMT+1). Basically it looks at the market range 2h prior London open.
  • Buy Stop order: The strategy will trigger a buy order if we break above the current range at HigestPrice + 1 pip, with taking profit order at the same distance as the current 2h market range, TP=(HigestPrice + (HigestPrice - LowestPrice)), and a stop loss right below the current 2h range, SL=(LowestPrice - 1).
  • Sell Stop order: The strategy will trigger a sell order if we break below the current range at LowestPrice - 1 pip, with taking profit order at the same distance as the current 2h market range, TP=(LowestPrice - (HigestPrice - LowestPrice)), and a stop loss right above the current 2h range, SL=(HigestPrice + 1).

Now that you have the summary of the strategy and we know what we want to build up it's very important to have a plan on how you are going to achieve building it. It's one thing to know what you want to build and another how you implement it, that's why we are going to break our build up strategy process in 3 stages. This systematic thinking is a common way for the understanding of a complex system that many programmers use it:

  1. First part we need to calculate the 7:00-9:00AM trading range, basically we want to find the high and the low of this range. Remember, our strategy will take buy position if breaks above this range and sell position if breaks below this range. We're going to use 2 distinct Groups of blocks: one for calculating the high and another one for calculating the low.
  2. Second part is to determine when the London open happens, we're going to check each hour candle until we find the one hour candle that matches London Open. Our strategy will start working only than.
  3. Last part is to create the order execution where we're going to use 2 distinct Groups of blocks one for Buy pending order and one for Sell pending order.

  • Calculating the range.

First think we're going to do is to calculate the highest point and the lowest point of the last 2h trading range zone prior London open and as per our trading rules requirement. In this stage we are going to use the Get Historical Candles block. We are going to proceed first by calculating the lowest level of our trading range.

Second block we are going to use is LoopViewer block, you can find the block here:right-hand side panel
(Repositorium)-Component-Logical-LoopViewer. What is actually doing is to store all the information taken from the last 24 candles, inside one block which is useful in build our strategy.

Third block that we are going to use is GetTimeUnits, you can find the block here: right-hand side panel
(Repositorium)-Component-Utils-GetTimeUnit. This block calculates the time of the tick which is going through
the block at this moment. The Result of this block would be stored in a new variable Current_time1. Next step,
which is very important, we go to block's settings and change the TimeUnit to hours.

Next step is to check if the current time is 7:00 AM(GMT+1 London time), and here we have to take in consideration that Dukascopy use as an input the GMT+0 time, so we'll have to subtract 1h when we introduce the data into the blocks, this is very important not to forget. At this stage we drag the "If logic" block to compare if the Current_time equal 7:00AM(GMT+1 London time).

Last thing that we are going to do at this stage is to store somewhere the lowest value we found at 7:00 AM(GMT+1) candle and here we are going to use the Assign block, you can find the block here: right-hand side panel (Repositorium)-Component-Mathematical-Assign. For getting the HighestPoint of the range press CTRL and select all the blocks and copy-paste them on the whiteboard and change the parameters like in the picture below. To save space on the whiteboard we are going to take a step further with our project and create two separate groups: one for Calculating the LowestPoint and one for calculating the HighestPoint, just press CTRL and select the adequate blocks, right click and select Make Group.

  • Figure 1. If you have been following all the steps you should get something like in the picture above. Parameters for GetHistorical Candles block: Instrument=GBPUSD; Candle Period=Hourly; OfferSide=Ask; Candles Amount=24; Output values=candles_24h. Parameters for the Loop Viewer block: Array of Data=candles_24h; Output values=All_Candels. Parameters for GetTimeUnit=CandleTime1; Output values=Current_time1. Parameters of the Assign block: Assigned Value=Candle Low; Output Value=LowestPoint.

  • Find The London Open

This should be quite simple we want to filter the candles for "hours", so our strategy should get ready to work right at the London open, that in the case we get any signal first. We need to use the "IF" block in order to go through each 1h candle to find the 1h London open candle. Next we need the GetTimeUnits block, this block calculates the time of the tick which is going through the block at this moment.We are going to store the output value in the current_time3. Basically as we go through each candle we are looking at the time of that candle and also we are going to store that value in a new variable current_time3.

Last think is to check if the current candle is actually the London open and we are going to use another "IF" block which is going to use as the first parameter the new variable "current_time3" which stores the value of the time of current candle. And we are going to compare it with a new variable calling it "London_open" with the assigned Start value at 8, which is 8:00GMT. The cycle will be finished and go through the next phase only when the current candle is the London Open.

  • Figure 2. We'll take a step further and create a new Group at this stage and make our strategy more easy to be
    followed, we're going to name this new group London Open. Just hold down CTRL-select the blocks-right click-
    Create Group.

After calculating the range and determine when the London open happens, we are one step closer to finish our strategy. We are going to discuss the next stage in building our strategy in the second part of the article. We'll take one step ahead and show you how to make the calculations for our Order Execution group of blocks, make the connections between our blocks, and which is more excited we're going to use new blocks that we haven't used before like Calculation block.

Stay tuned for PART 2 of the article, it will be released next week. But meanwhile you can exercise your programming skills and start using your creative side and start playing with Visual JForex and build up your own strategy. I hope you enjoyed my article and I'm waiting for your feedback.

Best Regards,
Translate to English Show original