Adding to Open

Viewing 5 posts - 1 through 5 (of 5 total)
  • #37879

    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)

    The complete code:

     

    #37900

    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 😀

    #37901

    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)

    #37903

    The pending orders will be of course visible in your broker orders list, just like any other ones 🙂

    #37905

    I was hoping I could skip the margin withdrawal 🙂 (other brokers do not take margin for pending orders)

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login