Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Skifree, Today, 03:41 AM
    3 responses
    12 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by traderqz, Yesterday, 09:06 AM
    5 responses
    32 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by guillembm, Today, 11:25 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by owensd, 04-21-2024, 11:34 PM
    9 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by trilliantrader, 04-10-2024, 09:33 PM
    7 responses
    25 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X