I am trying to create a simple system that takes the Open price and adds 28 points to it.
This far I can’t seem to get it working right. If I backtest it, the graph shows it always buys on the Open price + 0.5 (half the spread on DAX)
So I think the 28 is left out of the formula.
I have tried multiple things, with all the same result:
c1 = open + 28
c1 = high > (open+28)
c1 = open + 0.028
c1 = (open => 28)
Because the code is only read once per bar at its Close, the program will never met your c1 condition. In order to put a pending order on market (a conditional order) you’ll have to use a STOP or a LIMIT one. In your case, because you want to buy at an higher price than the actual one, you should use STOP order, like this:
The stop order will remain active only 1 bar. I use Close instead of Open, because it will put the order at current Close level (+28 points) of the candlestick (when the code is read) and at the next bar open. Hope it’s clear 😀
Thank you Nicolas, that helps a lot!
I can work with this.
If I use this code, will there be a conditional order added to my ‘working orders’ on IG?
Or will it only be visible on ProReal. (ProReal makes a market deal once the parameters are met)
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.