Creating timer to capture indicator values at intervals

Forums ProRealTime English forum ProBuilder support Creating timer to capture indicator values at intervals

Viewing 14 posts - 1 through 14 (of 14 total)
  • #170093

    Hello All,

    I have created an indicator (intraday only) that returns a number value that gets drawn on the chart (via drawtext). The number is dynamic and continuously changes from start of timeframe to end of timeframe (say 15mins) and then freezes on bar and starts again for fresh new bar.

    My question is:

    • Is it possible to set up a timer (say a 15 mins timer) and then capture the running value every 1 min interval and save that value in a separate variable to then draw it on the bar?
    • Is it possible to lookback across the intraday bars and locate the highest high bar and then capture the value that is shown on that bar so that I can draw it on Barindex[1] for example as an easy reminder?

    Thank you in advance

    #170738

    Can you make an example?

     

    #170756

    Thank you Roberto. The example could be really simple. Let’s assume I have basic indicator that is simply returning the “Price” of the current live bar. The time frame is 15 mins. Obviously the “Price” will fluctuate up and down for the duration of the time frame (i.e. 15 mins) and then closes at the end of the 15th minute and a new bar opens and so on…

    Now if I open a 1 min chart, I can simply observe the closing price at the end of each 1 min but I don’t want to do that.

    Instead, I want to write a code and apply it to the 15mins chart that does exactly what the 1 min chart does, i.e. capture the price of the bar at the end of each minute (therefore will capture 15 price values) and then DRAWTEXT each value on the chart.

    Should be simple with dynamic array variable I think 🙂

    Thanks

    #170766

    G_CFD_Trader – Please follow the forum rules. I have deleted your double post in another topic… and the reply that I wasted time giving to it. Here is the forum rule:

    • Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
    #170767

    Not a problem my friend. Please accept my apology.

    My regards,

    Walid

    #170775

    There you go:

     

    #170776

    I forgot to add this very first line:

    Should you want the text plotted at its actual  position, just replace high+range with Close15.

     

    #170781

    thanks Roberto but I think the code you have suggested above will draw on the chart only 1 value (the close at the end of the 15th minute). I don’t want that.

    I want it to draw 15 closes (1 close every 1 minute)

    #170784

    To draw the close every one minute you don’t need any TF other the 1-minute:

     

    #170789

    I need to draw the close every one minute on a 15 min chart?

    #170792

    As I previously mentioned, “close” is just an example. In reality I have an indicator that returning a live dynamic number that is changing continuously from bar open through to bar close (therefore similar to Close so that’s why I gave Close as example).

    So I need to capture the closing value of my indicator every 1 minute that elapses and draw it on chart (so in total I need to capture and draw 15 readings, minute1, minute2, minute 3………minute 15)

    #170794

    You cannot draw every minute on the 15-minute chart.

    You can use the above code, choosing the line that suits you best, every tick or after closing.

     

    #170796

    Isn’t it possible with dynamic array? Define a dynamic array that can store 15 values (1 value every 1 minute). Then convert the array variables back to standard variables in order to draw each value on the chart. Not possible?

    #170798

    No, it isn’t.

     

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

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