Exit trade just before the close for the day

Forums ProRealTime English forum ProOrder support Exit trade just before the close for the day

Viewing 9 posts - 1 through 9 (of 9 total)
  • #167702

    Hi,
    I have need to test a strategy that close an open trade just before (say 17:20 when the session close at 17:30) close of the 5th day.
    Do anyone have a code snippet for this?

     

    #167704

    this should do it:

     

    1 user thanked author for this post.
    #167705

    When using the example given by nonetheless you have to ensure that the chart you are using the strategy on has a 172000 candle. So you must run it on  a TF of  10 minutes or faster.

    2 users thanked author for this post.
    #167708

    Thank you

    I guess I was a bit unclear about the day of exit. I meant 5th day after entry not day of week.
    Do I have to choose a time unit in backtesting that correspond to time? In the this case 1 hour of less?
    In this strategy I have only daily bars. Does that mean I can’t solve my need?

    #167712

    @Vonasi: You answered one of my question before I had written it 😉

    #167720

    In this strategy I have only daily bars

    Sorry Erike, when you mentioned 17:20, I assumed you were working with a short time frame. I may be wrong but I don’t think you can close in the middle of a daily candle without using MTF

    1 user thanked author for this post.
    #167745

    No problems @nonetheless .
    I guess I have to read up on MTF. Any suggestions were to start?

    #167750
    #167761

    There you go (not tested):

    You need to run this strategy from a 10-minute (or lower) chart.

     

    2 users thanked author for this post.
Viewing 9 posts - 1 through 9 (of 9 total)

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