Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ind. To calculate directly from 4H

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

    Ind. To calculate directly from 4H

    Hi, im trying to make this indicator to calculate directly from a 4H chart


    added the period:

    Add(PeriodType.Minute, 240);

    replaced the Close[0] for: Closes[1][0]


    the checked for enough bars:

    if ( CurrentBars[1] <= longLeg || CurrentBars[1] <= shortLeg) return;

    but its not working, when i go down from the 4H to a smaller timeframe the indicator addapts to that timeframe, so i don't know what im doing wrong

    here is the file: KBT_RubberBands_V1.cs

    #2
    Hello kabott,

    Thanks for your post.

    Calculating the indicator value on BarsInProgress 0 may not give you the result you would expect, and I may suggest to calculate the indicator using the data series you added. (Calculate on BarsInProgress == 1) After calculating the values in BarsInProgress == 1, set the plots in BarsInProgress == 0.

    For example:

    Code:
    if (BarsInProgress == 1) 
    {            
        // Calculate Indi
    }
    else if (BarsInProgress == 0)
    {
        MultiHigh.Set (SyncMulti * MultiW);
        MultiLow.Set (-SyncMulti * MultiW);
        MultiOsc.Set (multiOsc);
    }
    If this does not resolve your inquiry, could you further elaborate on the results you are getting and the results you expect?

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    82 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    43 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    56 views
    0 likes
    Last Post CarlTrading  
    Working...
    X