Is it possible to buy at open?

Forums ProRealTime English forum ProOrder support Is it possible to buy at open?

Viewing 6 posts - 1 through 6 (of 6 total)
  • #86011

    Im wondering if there is a way to buy/sell exactly at the open on a lower timeframe strategy.

    The following code works at backtest but not when running demo.

     

     

    #86014

    On a 5 minute chart if you want to buy at 1530 then just write:

    Does it buy in demo at a different time if so maybe it is your chart time settings?

    1 user thanked author for this post.
    #86038

    Thank you for your answer!

    I want to execute an order at exactly the open. But i want one parameter to be where the open is. For example over or below ma200.

    The code below works in backtest but i fear that it will execute first 1 candle after the open. Guess il have to see tomorrow.

     

     

     

    #86039

    All decisions are made by any code at the close of a candle. So on your 5 minute chart the candle that opens at 1525 and closes at 1530 is the one you want to use. That candle has a TIME = 153000 and an OPENTIME = 152500.

    So if you use OPEN[0] < AVERAGE[200] then it will be the opening price at 1525 that is used for the comparison. You cannot use the opening price of the next candle as all decisions are made at the close of a candle. This is only an issue in markets where there is a big gap between the close of the 1525 candle and the open of the 1530 candle.

    I hope this makes things clearer!

    Note: Also if you are not using MTF then you do not need to put the TIMEFRAME command in your code. just launch it on 5 min time frame and it will make decisions based on this.

    2 users thanked author for this post.
    #86059

    So tried the code on the dax open now and it didnt execute, still works on backtests. Im using custom timezone UTC +01:00 with custom trading hours 09:00:00-17:30:00

    im guessing that i have to change the custom time to 08:55:00 for it to work.  since the open[0]>ma200 is outside the timezones

     

    #86062

    I don’t use any custom hours as it just adds an extra level of confusion in my mind so I just use my memory to know when markets open and close on a UTC0000 chart so I have to guess that you are right about needing a 0855 candle as if you have set the chart to display from 0900 onwards then you have eliminated your decision candle which opens at 0855 and closes at 0900.

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

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