Hi looking for help on why my strategies work in backtest but not in autotrade – cant find any help anywhere – guess its a schoolboy error – but what is it?
And to add – Basics are good – manual trading works fine. Strategies running live in Backtest open and close as expected. Autotrading accepts the code OK and strategies are shown as running., but when running at the same time as backtest no positions open. Turning off the backtest makes no difference, positions do not open in autotrade. Code is only 100 or so lines and no big loops – running one minute candles with 200 on chart.
All other details happy to supply – I’m clearly missing something.
What Instrument and what position size are you using?
You may have < min pos size in your code, lots of us have made that error from time to time.
OR maybe you set the max setting (when you started your Algo) at less than the pos size that you are using?
Thanks for coming back – I am spread betting the DOW (DJI) at £0.20 per point.
I don’t have “<min pos size” (or similar) in the code and am not aware that I could have set a max setting.
Live trade does work OK on DJI at £0.20p
£0.2 per point is okay, this is the minimum.
You must have set a a max else ProOrder would not let you start an Algo, we can’t leave the setting blank / null.
Try starting another and you will see the max setting.
Set max at at least 1 if using 0.2 per point.
ah – apologies – yes I have set a “max position”. It is at £0.20 – this is the field on the form that opens when I active the the strategy for autotrading. There are other data on the form that perhaps are affecting the service: image attached (hope its big enough to read – not sure how to check) – not sure it uploads – (this is an edit of the message – I have selected the file and it is 112 Kbyte – so good for size) cant see an upload button though – maybe it does maybe it don’t – sorry
Set the Max setting at 1 and your problems will be solved!
1 is the MIN setting for the MAX setting! 😀
and a thought – I have the line:-
BUY 1 PERPOINT AT MARKET
in the code but set the max at £0.20 – does this cause a conflict perhaps – I thought the “1” meant one contract not “£1” – could that be the isuue do you think?
I am spread betting the DOW (DJI) at £0.20 per point.
You said above before and now you are saying …
BUY 1 PERPOINT AT MARKET in the code
But anyway Yes the Max setting ALWAYS has to be >= the max pos size we use in our code.
Many thanks – and we got there quickly too..
schoolboy error as I thought – I had thought the code bought units and the autotrade form set the price – not so!
The code sets the price of the position while the autotrade form has recorded a price the code cannot exceed – a wise safety feature.
thanks again folks
Glad you are sorted now.
Another point you may not know about … have you enabled your Demo Account on your IG Dashboard under PRT Settings?
Yes thanks – I have been using the demo account but at £1.00p max trade – so no fault occurred! I looked back at the Programming Guide (ProBacktest and ProOrder) but like before it does seem to say the number in the buy command is the quantity, but I guess this is for shares and contracts. Spread betting, being different, maybe hasn’t been written up in detail. (e.g. “perpoint” gives me a not found). Is there a better source of programming guide for spread betting do you know?