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 funk10101, Today, 12:02 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by GLFX005, Today, 03:23 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by nandhumca, Yesterday, 03:41 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by The_Sec, Yesterday, 03:37 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by vecnopus, Today, 06:15 AM
    0 responses
    1 view
    0 likes
    Last Post vecnopus  
    Working...
    X