Basically what I want to do is if the open is above the BuyLine (signal=1) to buy a hit of that line with stop at the SellLine and vice versa, if the open is below the SellLine (signal=-1) to sell a hit of the SellLine with stop at the BuyLine.
The problem is that the backtest gives trades at wrong places. Can you help me spot the problem in the code please?
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue