Sum open to close of candles in a defined time range?

Forums ProRealTime English forum ProBuilder support Sum open to close of candles in a defined time range?

Viewing 11 posts - 1 through 11 (of 11 total)
  • #102542

    I’m writing a validation indicator because the system I’m working on works off the open of the current candle, not the evaluation of it on the next candle open.

    I’m using a trading session of TIME > 080000 AND < TIME 100000 and would like to total the SUM of Close-Open for long trades and Open-Close for short i.e. how many points could be made trading the open to close in the trading session for the candles that meet the criteria. Easy to do for a single candle but I’m not sure how to total them for the trading session.

    So if I was trading a 2 hour session on a 30 min timeframe and only two candles meet the criteria then I only want to sum those two. The timeframe might be an odd one like 36 mins.

    Some candles might be long or short in the trading session but that’s worked out on the criteria, it’s the totalling I need help with.

    Is this possible please?

    Thanks, Rob

    #102543

    There you go:

    after EndTime both bullish and bearish candlesticks will have been tallied.

    Next day the counting will be restarded at StartTime.

     

    1 user thanked author for this post.
    #102544

    Link to above code added to here

    Snippet Link Library

     

    1 user thanked author for this post.
    #102545

    There you go:

    after EndTime both bullish and bearish candlesticks will have been tallied.

    Next day the counting will be restarded at StartTime.

    Hi Roberto

    This is close to what I need but it adds the cumulative bullish/bearish points to the previous session. I was hoping just to capture the number of bullish/bearish points for each individual session.

    Does that make sense? I’ve tried to show this in the attached image.

    Thanks again

    Rob

    #102547

    Please do not quote posts unless necessary.

    Everyday, at StartTime, it restarts.

    The candle must CLOSE at StartTime, if you want to use a custom TF,  say 7 or 36 minute TF you must either:

    1 – change the StartTime and EndTime

    2 – replace = with < at line 7.

    #102548

    You also need to remove = from line 11 if you want the time interval to be only > than StartTime and < EndTime.

    #102549

    Thanks Roberto but it’s still the total for the period rather than each candle that I’m after.

    Thanks though.

    Rob

    #102550

    I read you could do that individually but wanted their sum,

    A single candle count is easy;

    Of course you’ll have to add your conditions, other than bullish or bearish, if any, at lines 12 and 15.

    My code is generic and counts all of them.

    2 users thanked author for this post.
    #148219

    Hi Roberto thanks for the code listed above would it be possible to adapt it so it does a rolling count of bear and bullish candles that updates every hour ?  I’ve been looking for something to help remove some losses with a long position on a 1 minute time frame and wondered if this could be adapted ?  Happy to open a new thread if needed ?

    Thanks in advance.

    #148241

    There you go:

     

    1 user thanked author for this post.
    #148251

    Perfect thanks Roberto.:)

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

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