This is my second article about how you can build your own automated strategy without indicators and using Visual JForex. My previous article London Breakout Strategy Using Visul JForex (part 1) has left outside few more things before our strategy can be ready for work, we're going to speak about this in a few moments. By now, your Visual JForex programming knowledge must have picked up and following the next steps won't give you much headache. We already know that our strategy has been broken in three stages:

  1. Calculating the Range.
  2. London Open.
  3. Order Execution.

So far we have mange to create our blocks for calculating the range prior London open and the blocks that determine when the London open happens. Now we are one step closer to finish our strategy and this article will take you 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. Now, if you haven't got excited yet, we are going to add a twist to our strategy and make things more complicated but at the same time very easy to follow.

  • Order execution

On this phase we are going to use new blocks that we haven't used before like Calculation block. We are going to actually fuse four of this kind of blocks for each group of order execution. For the buy side:

  • One block calculates the buy trigger point by adding 1 point to the HighestPoint, result would be stored in a new variable buy_buffer.
  • The second block calculates the pip range prior London Open, result would be stored in a new variable: range (HigehestPoint-LowestPoint).
  • Next block will calculate the take profit point, which is the same distance as our range so we had to sum the HigehestPoint and the range, result would be stored in a new variable BuyOrder_TakeProfit.
  • The last block will calculate our stop loss point, which is 1 pip below our range, so we subtract 1 from the LowestPoint, result would be stored in a new variable BuyOrder_StopLoss.

The only think we must add on this phase for our strategy and be one step closer to finish the strategy is to add the Pending order block and filing in with the correct parameters.

  • Figure 1. Make sure you fill the Pending Order block with the correct parameters like in the picture above. To make our space clean we'll create another group out of this new blocks which we are going to call BuyOrder_Calculation. Press down CTRL-select the block-right click-Create Group. Next step is to copy-paste this new Group for creating the Sell order and make the necessary adjustments for block's parameters like in the picture above, and name the new Group SellOrder_Calculation.

We have to pull together all this blocks and make the necessary connections between them in order for our strategy to be finished and ready to work. Make sure you draw the connection the same as in the picture below. On this step we're going to use new blocks that we haven't used before like Multiple Action block which allow us to connect London Open group with the groups for calculating the High&Low. By using the Create Group option we have managed to not only save space on the whiteboard but also make it easier for anyone to understand the process thinking of this strategy.

  • Figure 2. London Breakout Strategy is ready for use. Pay attention on how we draw the connections.

Although our strategy may be finished as I said in the introduction of the article we are going to add a little trick to it. So the last thing we are going to do now is to make sure that we're not going to have any position open over the weekend. Holding a position over the weekend entails a certain amount of risk which we are not ready to take it.

  • Close over the weekend positions

First we are going through the logic on how we are going to build and incorporate this in our strategy. Remember what we have spoke in the first part of the article about the importance to have a plan on how you are going to achieve building the strategy. For this stage we will have to check first what day of the week is, when we'll find it's Friday we'll move ahead and check for the time of the day, if it's 18:00 GMT we're going to look through all of our open positions and pending position and store them in a new variable by using the Loop Viewer block, when we are done all open positions will be closed:
  • In order to check the day of the week we'll use the GetTimeUnit block from right-hand side panel (Repositorium)-Component-Utils-GetTimeUnit. This block calculates the day of the week which is going through the block at this moment. The Result of this block would be stored in a new variable day_week. Next step, which is very important, we go to block's settings and change the TimeUnit to Day of week.
  • Next step we need the "If logic" block to check when the new variable day_week equals five(Friday is the 5th day of the week), the cycle will continue until day_week=5 and only than move to the next phase.
  • After we found it's Friday we need to check what time of the day it is. Here we're going to use the variable current_time3 that stores the time of the day. Remember we have already created this variable in the first part of the article. Next step we need the "If logic" block to check when the variable current_time3 equal 18:00 GMT. After 18:00 GMT we want our positions closed.
  • Loop Viewer block you can find the block here: right-hand side panel (Repositorium)-Component-Logical-LoopViewer. This block will catch inside all our positions and at the end of the cycle we want to close the positions by using the Close and Cancel Position block which can be found here: right-hand side panel (Repositorium)-Component-Trading-Close and Cancel Position.

  • Figure 3. Parameters for Loop Viewer block: Input value= All Positions variable which can be found left-hand side panel (Variables)-Position Info-All Positions; Output value= new variable close_position. Parameters for Close and Cancel Position block: Input value= close_position. 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 Over the weekend. Just hold down CTRL-select the blocks-right click-Create Group.

The main goal of my article was to show you guys that you can create your own automated strategy without using any indicators whatsoever. With Visual JForex the possibilities are endless, by now you must know the majority of the Visual JForex blocks, so now it's time for you to use 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.

  • Figure 4. London Breakout Strategy. Strategy builded successfully.

Best Regards,
Translate to English Show original