close position last bar intrayday

Forums ProRealTime English forum ProOrder support close position last bar intrayday

  • This topic has 7 replies, 4 voices, and was last updated 7 years ago by avatarPaul.
Viewing 8 posts - 1 through 8 (of 8 total)
  • #47157

    Hi,

     

    You can use time to set a exit-time to close a position for intraday. But is it possible to automatically close at the last bar of a intraday chart? Which adjust itself based on timeframe. If selected daily it should be disregarded.

     

    Regards,

    Paul

     

    #47158

    I don’t think so. Would be convenient to have though.

    You have to take care of this yourself and even keep in mind that there can be differences in the time when a market closes when there is a shift from summer time to winter time or vice versa. And this is different for different instruments. 🙂

     

    #47174

    Perhaps something like this? You could make an indicator that knows which bar is the last in each time frame.

     

    #47188

    This won’t work. Number of bars is dependent on the TF. So I think you have to take care of this yourself.

    #47282

    You can recognize on which timeframe you are on with this little code snippet:

    So it would be possible to set a different “intradaybarindex” for each of the found timeframe to close your orders (or event a different Time).

    1 user thanked author for this post.
    #47379

    Thanks for the responses.

     

    That’s an interesting snippet Nicolas. It gives new possibilities to play with.

    A look at intradaybarindex set as indicator shows that not everyday has the same number of bars although the longer the timeframe the more consistent they become.

    Because of that I guess it doesn’t work to set a close at a specific bar based on selected timeframe.

    #47382

    Even if intraday bars are not the same exact number each day, a range of bars quantity could be determined for each of the timeframe?

    Anyway, with the timeframe code snippet I posted, you should also be able to set a time to close the orders, for example, if the timeframe is 5 minutes, close the trade @ 235500 or if the timeframe is 1 minute, close orders @ 235900.. etc.

    #47390

    yes set time to close orders based on timeframe should work indeed. I focused on a bar.  Going to try that way! Thanks

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

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