Arrays & Same Candle Programming

Forums ProRealTime English forum ProBuilder support Arrays & Same Candle Programming

Viewing 5 posts - 1 through 5 (of 5 total)
  • #232352

    Hi All,

    I though I would ask one last time if the below is possible in current version of ProBuilder.

    If IsLastBarUpdate is true then

    1. store price and say average[20] value of current candle in an array variable.

    Then when IsLastBarUpdate is true again then

    1. there is nothing to compare since array above only has 1 price and 1 average[20] value
    2. just store the second reading of price and second reading of average[20] value in the same array above

    Then when IsLastBarUpdate is true again then

    1. Check price against the prices stored in array above
    2. if there is a match then compare the average[20] value of this reading with the average[20] value of the matched price in the array then continue storing the two new values in the array
    3. If there is not a price match, then just store the values in the array as usual.

    Continue doing the above whilst IsLastUpdate continues to be true until close of the current Bar.

    Can current version of Probuilder handle the above or not yet?

    Many thanks

    #232444

    hi… see if this is getting anywhere!

    druby

     

    #232481

    Can you make an example with some data?

    In addition, what would you like to do with the array containing those data?

     

    #232504

    Hi Roberto,

    Drubi did a good job above but unfortunately he had to use multi timeframes strategy (like a trick) which gives rise to two issues:

    1. I have to apply the code to the lower timeframe which is a multiple of the higher timeframe
    2. Perhaps Prorealcode is not ready yet or cannot handle capturing data from a current Bar directly on any timeframe once chooses.

    I will try to re-explain with an example as you asked:

    • Assume I am looking at a 1 hr time frame.
    • I have a current Bar obviously with price (close) moving up and down during market session (or assume after 10am i.e. after market open)
    • Assume also I have an indicator running (RSI, MACD, VWAP, etc…) which also registers a reading every time the current bar price moves up and down

    Now given the above:

    • Can prorealcode use an expression like (if islastbarupdate then) or any other expression for that matter to
      • Capture both the price and the indicator reading value and store them as fixed values somewhere for later use?
      • Capture the next price and indicator reading everytime the bar updates and store them next to the first readings above
      • Keep on capturing and storing price and indicator readings for as long as the current bar is updating?
      • The above has to be done directly to the current bar on the one timeframe itself without the need to resort to a lower timeframe as a trick to get around the issue

    Whilst the code is continually storing, I just want to for example Print the data and maybe print or display the cumsum or summation of the data from open time of the Bar (say 10am) etc which should not be hard to do. The hard part is the live continual capture and storing of the data as I described above.

    Tnx

    #232517

    I tried to do like you said but AFAIK theres no way to store tick data in any array or variables, much less use them to trade in higher timeframes. You just can  view it if you previously declare <defparam drawonlastbaronly = true>

    Please someone correct me if I am wrong.

    1 user thanked author for this post.
Viewing 5 posts - 1 through 5 (of 5 total)

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