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 techgetgame, Yesterday, 11:42 PM
    0 responses
    8 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,613 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Yesterday, 05:56 PM
    0 responses
    10 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    20 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Working...
    X