Sunday data code

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

    Hi guys, i did a very simple system that buys if close is  over yesterday Max and sells short if close is under yesterday Min. The problem is that he takes in consideration the Sunday data in that small time market is open ( in the Forex for example market session opens on Sunday at 23.00 at my GMT), so on Monday il will have a opened position based on that market Sunday small time data and i dont want this, want considerating only the data from Monday to Friday, how i solve this ? Without excluding trade on Monday possibly, thanks

     

    #200990

    Post your topic in the correct forum:
    _ ProRealTime Platform Support: only platform related issues.
    _ ProOrder: only strategy topics.
    _ ProBuilder: only indicator topics.
    _ ProScreener: only screener topics
    _ General Discussion: any other topics.
    _ Welcome New Members: for new forum members to introduce themselves.

    I moved it to ProOrder, as it deals with automated strategies.

    Thank you 🙂

    Which timeframe are you using?

     

    #201021

    Oh sorry, thank you Roberto.

    I’m testing on timeframe  h1 or h2 but. But consider that i use “dlow(1)” and “dhigh(1)” which take yesterday’s high and low regardless of the timeframe so that is not so important, i just need to exclude Sunday from reading the data

    #201028

    Then you need to replace Dlow(1) with Dlow(2) when it’s Monday (which is identified by OpenDayOfWeek = 1). Example:

    #201030

    Ok nice idea it seems to work , thanks!

    Another question out of curiosity:

    Is there a way to place an order on the same current bar instead of the next bar? Because I noticed that when he finds the right condition he place order and open the trade to the next bar anyway, there is a way to do it instantly in the same bar which find condition without waiting for the next bar?

    #201036
    #201043

    ok thanks i tried but it doesn’t work because it tells me to use multiples of the timeframe default period. If I run it on h1 default and in the code I put smaller timeframes like 1 seconds or 5 minutes it gives me the error , is there a way to avoid it?

    #201046

    If you read the links above you will learn how to use multiple timeframes.

    The DEFAULT timeframe is the one that sets the pace of execution and it is the one used on your chart and it MUST be the smallest timeframe used in your code. ALL other greater timeframes must be multiples of the default one.

    If your default Timeframe is 15 minutes, then you can use 30 minutes, 1 hour (or 60 minutes), etc… but you CANNOT use 20 minutes, as it’s not a multiple of 15.

     

     

    #201051

    hmm ok i’ll try to do in this way,  even if i dont understand why. It would have been better if it could work in both ways, PRT still has so many limitations. Thanks!

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