Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to get the indicator values in my strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to get the indicator values in my strategy

    i have a indicator that needs 25 bars of daily to process values and plots it in 30 minute timeframe. I use this indicator in my strategy . when i run the bar replay, it takes atleast 5 days of data to be processed before the strategy starts showing up indicator values.
    how can i design it so my indicator values are processed as soon as the real time data flows in.
    i load 25 days of data and have tick replay turned on.

    here is my header for the onbarreplay in strategy
    protected override void OnBarUpdate()
    {

    try{
    if(BarsInProgress>0)
    return;

    if (State != State.Realtime)
    return;



    Here is my indicator header
    protected override void OnBarUpdate()
    {
    try
    {

    if (CurrentBars[0] < 51 || CurrentBars[2] < 22) // bar 0 = 30 minutes, bars 1 = indaily.
    return;

    Print(currTime() + "Got tick from indicator");

    #2
    Hello junkone, thanks for writing in.

    What is the actual issue you are seeing? It looks like the indicator adds a data series with AddDataSeries, is the hosting strategy also adding this data series? This is required in multi time frame scripts that are hosted by other scripts.

    I look forward to hearing from you.

    Comment


      #3
      i am loading a indicator in my strategy that needs 22 daily bars. i have set my data series to load 25 bars but you can see from screenshot, it only loads from dec 14th which may not have 25 trading bars.
      i can also see that there are only 16 daily bars loaded so far on my strategy. i did a print on the number of bars that is recieved on daily timeframe. i connect to fxcm for data and trading.

      Click image for larger version

Name:	33QIouK.png
Views:	195
Size:	155.3 KB
ID:	1135460

      Comment


        #4
        Hello junkone, thanks for your reply.

        Historical tick data is needed to run tick replay, so it is likely you are requesting too much tick data and it is returning the maximum limit. If you load up an indicator with no Tick Replay that only uses Daily bars it would go back much further. You will need to download the tick data or Import it for the current chart to load properly. You may also go into Tools>Options>Market Data> Enable Record Live data as historical. Also, from the screen shot, it looks like your BarsRequiredToPlot property is still set to 20, set this lower if you want the indicator to start plotting earlier.

        Please let me know if I can assist any further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X