Forums ProRealTime English forum ProBuilder support Arrays & Same Candle Programming Reply To: Arrays & Same Candle Programming

#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