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 llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Working...
    X