Forums ProRealTime English forum ProOrder support Request for a simple strategy to be coded for spread betting Reply To: Request for a simple strategy to be coded for spread betting

#108192

Hi, and thank you so much for taking a bash on the code for this. Can I just ask if this trails the stop loss with each new candle that is formed or if it fixes the stop at 15 below the low on entry?

I only ask because when I run the backtest on the code you’ve given me it gets the entries just as I would do it manually, but the exits are different to where I’m taking them manually, so I feel like I’ve possibly left something out of my description or not conveyed it well.

I have written on a screengrab of one trade example to highlight where my intended system differs from the code you’ve included. Follow the steps in the order I’ve numbered them. You can see where the PRT backtesting has entered and exited and where I’d need it to exit. Basically the SL is not moving along when a new candle is formed (it’s staying where it was initially placed). This is the major problem here from what I can see.

Additionally, I notice this code deals in ‘contracts’ rather than ‘bet size’, would this still work for automating trading on a spread bet account within PRT?

I hope this is helpful. Just want to reiterate how much I appreciate you taking the time to help with this.

Regards

Matt