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

MultiTimeframe Strategy Indicator disappears

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

    MultiTimeframe Strategy Indicator disappears

    Hi, this is my script so far but doesnt work, im trying to use 2 Timeframes, BarArray[0] as the deffault and a 240mintes as BarArray[1]




    protected override void Initialize()
    {

    _HA = KBT_HeikenAshi_Naked_v1( Closes[0], haPeriods, haType );
    Add ( _HA );

    Add(PeriodType.Minute, 240);
    _SF = KBT_SuperFrame_ANA_Naked_V2( Closes[1] , filterLineOffset , myType , spLength , spMultiplier );
    Add ( _SF );
    }


    protected override void OnBarUpdate()
    {


    if ( CurrentBars[0] <= (haPeriods * 2 ) || CurrentBars[1] <= spLength ) return;
    {

    if (BarsInProgress != 0)
    return;

    //Entry code

    }

    but the indicators get both applyed to the default 15 mnt timeframe, any help please?

    Thanks in advance.
    Last edited by kabott; 11-12-2018, 11:08 AM.

    #2
    Hello kabott,

    Thanks for your post.

    The additional data series would not be properly referenced in Initialize().

    I may suggest to take an approach similar to the SampleStrategyPlot example to have plots added to the strategy and to assign those plots with the indicator value on BarsInProgrress == 0 iterations.

    I'll include a link and a modified example to demonstrate using SMA's.

    Plotting from a NinjaScript Strategy - https://ninjatrader.com/support/help..._a_ninjasc.htm

    Please let us know if you have any additional questions.

    Attached Files
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    21 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    10 views
    0 likes
    Last Post cre8able  
    Working...
    X