Stop Loss Grid Part 2

A follow up to the earlier Stop Loss Grid post that fixes a code issue and reduces over trading.

This is a follow up to an earlier video on a grid trading strategy that included a stop out and claimed profit on a price pullback.

The strategy comes from Expert4x and the code was written to exactly match the strategy as described.

This follow up fixes some issues from the earlier code.

  • Take care of cases where the expert is to exit after reaching stop loss. This is a piece of code I mentioned in the first video that could be made more reliable.
  • Fix an overtrading issue from the strategy. Removes some trades that add no value.
  • Remove a no value hedged pair of trades. The original 2 trades when the grid opens have no value.
  • Fix an area where code is duplicated between long and short positions. The video was recorded to show minimum change from the original code when addressing the duplicate code problem but I can see that it could be better written if not based on the original.

To follow this video you will need the code and the Orchard Framework from the original video.

Original code:

If you have a suggestion or request for a future tutorial you can leave details in our Topic Requests forum or vote for existing requests. Make sure the requests are clear and if you refer to a strategy somewhere leave a link to the strategy

4 thoughts on “Stop Loss Grid Part 2”

  1. Again, it is explained in the video. Did you watch the video or just download the code for a free expert?

  2. IKnowSomeTrading

    The script stops after one cycle on backtest. How to make it trade continuously?

Leave a Comment

Scroll to Top