I just posted an example strategy that shows how to ensure that an entry in the market stays in for at least one bar before it can trigger a stoploss. I used the SampleMACrossOver as the basis for the strategy as I wanted to post a working strategy rather than just a shell.
I must state that I do not have much faith in the MovingAverageCrossOver as a trading strategy, so even though when optimized, (as in the picture that accompanies the strategy), it shows a profit, remember that backtesting is different from live trading. That means one needs to think very carefully before turning such a strategy live on a real account. I used it ONLY as a working example, not a strategy to actually trade with.
To use it as a template, you should replace the code remarked with: "... //B...ish trade conditions; replace with your own" with code that describes your set of conditions for entering the market.
Comment