Buy/Sell at open +/- xx pips/points

Forums ProRealTime English forum ProOrder support Buy/Sell at open +/- xx pips/points

Viewing 7 posts - 1 through 7 (of 7 total)
  • #189606

    Hi,

    I have an idea where I want to buy or sell at the open of the next candle +  2 pips/points in the 1-min timeframe

    Now I created the following code:

    OrderTollerance = 2
    c1 = open>close[1]

    if not onmarket and c1 and hora1 and hora2 then
    Buy possize contract at open+OrderTollerance stop
    endif

     

    But when I execute the code act randomly.

    Sometime it execute direct at Open of the next candle

    Sometimes it sets buy/sell limit above/under the Open of the previous candle

    Sometime it set a buy/sell limit of 1 above/under the Open

     

    Is the code correct?

    #189607

     

    #189613

    You are likely to be using a STOP pending order, instead of a LIMIT one.

    Can you mke an example of the bar where your conditions are met and the open of which bar you want to enter.

    Additionally, do you want to to buy 2 pips above or below the OPEN price?

     

    #189627

    Hi,

    The idea is to buy 2 pips above the OPEN price.

    See screenshot attached

     

    #189629

    Ok, you only have to replace STOP with LIMIT in line 6.

     

    #189632

    Hi,

    I changed the code with LIMIT and it is still the same.

    The entry is still at the OPEN price (the using the 2 points) and a few candles later it set the entry 2 points below the OPEN price of the previous candle (see screenshot)

    It seems that the ‘OrderTollerance’ is not working

     

     

     

    #189642

    Because the current price (CLOSE) is too close to the entry price (on DAX usually IG requires at least 6 points from the entry price, but it may change when volatility is high) and is entered incorrectly (in live trading the strategy would be interrupted).

    On the IG website you may find the values for each instrument/asset.

    This is the code with the support for the distance:

    I commented out the line where the entry is at MARKET because too close to the Entry price. You may remove the two slashes to enable entering at MARKET in that case.

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

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