store data based on event and use for future calculation

Forums ProRealTime English forum ProBuilder support store data based on event and use for future calculation

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • #153788

    Hi,

    Im wondering if data (eg. Donchian Channel Down) in a given event (price > donchian channel middle) can be collected everytime the event happened and used it in the future calculation.

    Say, there are 4x an event happen in a given timeframe.  Note: counter or data collection, will reset if price crosses under donchianMiddle

    I intend to have 2 calcuations:

    Calcuation will be for maximum: 2nd time event happen, get the max of DCDatEVENT (first and second); 3rd time (max of the last 3), 4th time (max of all 4).  What is the code for this?

    Use the latest DCDatEvent as stop loss

    appreciate any response.

     

    #153828

    Note: counter or data collection, will reset if price crosses under donchianMiddle

    Ok, but in order for the price to cross over the Middle line, it needs first to cross under, so how do you want to store multiple price levels if you reset everything before any consecutive event?

    #153832

    Hi Nicolas,

    Im looking at crosses under as an early exit points.

    But there are cases that I see that there are no crosses under that happens but price opens lower than the middle and crosses over.

    #153835

    price > donchian channel middle

    is different from

    price crosses over donchian channel middle

    please define what is the condition to use the DonchianChannelDown as a stoploss.

    By the way, it will never trigger as you “early exit” when you cross the middle line!

    #153840

    yes, they are differentand  those are the scenarios that im lookimg for ie.  4 times the PRICE<MIDDLE, then later after candles or right after PRICE CROSSES OVER MIDDLE without crossing the donchiandown.

    so in addition to above, buy and sell codes will be like this.

    the one I would like to add in the sell code are the either of the 2 options stated in the initial post based on succeeding DCDatEvent during possible 2 or more events of price crosses over donchianmiddle

    -as per the initial post, it should either the maximum of all previous DCDatEvent  or the latest DCDatEvent.

     

     

    #153856

    But there are cases that I see that there are no crosses under that happens but price opens lower than the middle and crosses over.

    If the price was above and now below, it is a crossover.

    Well, at this point, I think a picture would be way better to explain what you want, cause I’m lost now…

    #153861

    Hi Nicola,

    Please see attached.  there will be instances that there is no cross under of price since open of the candlestick is already below donchianmiddle.

    #153863

    The confusion might be on the term “price” which I meant “close” and encoded incorreclty as well

    #154039

    Appreciate any possible solution to this topic.  Many thabks in advance.

    #154134

    Found a psoosible solution but not working fully as intended.  create an indicator first to know how ot would look like.

    note, this is for target2: use the latest donchianmiddle during triggerevent

    appreciate who could advice tge changes required to the code.  i dont know why it goes up after 10bars

     

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

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