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

Strategy Builder with Cumulative Delta

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

    Strategy Builder with Cumulative Delta

    Hi,

    I'm trying to make a simple strategy with the Strategy Builder. Idea is to color background when the 16 EMA of the cumulative delta is rising or falling.

    So the conditions are: Rising - EMA16 (Input series - OrderFlowCumulativeDelta) - True

    Unfortunately I have a Log message I don't understand.

    What is here the problem?
    Attached Files

    #2
    Hello michi08,

    The Order Flow + indicators and bar types require advanced code to call from a script.
    Unfortunately, because of this, these cannot be used in the Strategy Builder. To call these scripts from NinjaScript the strategy will need to be unlocked and coded by hand.

    The Order Flow Cumulative Delta, Order Flow Volumetric Bars, and Order Flow VWAP are able to be called from an unlocked script.
    Below are links to the help guide.




    The Order Flow Market Depth Map, Order Flow Trade Detector, and Order Flow Volume Profile scripts are not supported to be called from an unlocked NinjaScript.​

    The Order Flow Cumulative Delta indicator adds a 1 tick series with AddDataSeries() to process all of the tick values. Any hosting strategy will have to do this same.

    From the example in the help guide:
    Code:
    // A 1 tick data series must be added to the OnStateChange() as this indicator runs off of tick data
    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    }
    From AddDataSeries() in the Help Guide:

    "Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments"

    Help guide: NinjaScript > Language Reference > Common > AddDataSeries()

    Also from the Help Guide:

    ”Note: To maximize data loading performance, any NinjaScript object (indicator or strategy as host) which references a multi-series indicator which calls AddDataSeries must include it's own calls to AddDataSeries(). For example, if the code above was included in an indicator, and that indicator was referenced in a NinjaScript strategy, then the hosting strategy will need to include the same calls to AddDataSeries(). When the strategy adds the additional Bars objects, the calls to AddDataSeries() within the indicator will be ignored. If the Bars objects are not added by the strategy in such cases, and error will be thrown in the Log tab of the Control Center that would read - "A hosted indicator tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state."

    Help guide: NinjaScript > Educational Resources > Multi-Time Frame & Instruments​​
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ETFVoyageur, Today, 02:04 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by WHICKED, 04-26-2024, 12:45 PM
    4 responses
    46 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by samish18, 04-17-2024, 08:57 AM
    20 responses
    96 views
    0 likes
    Last Post samish18  
    Started by ezrollin, 02-26-2022, 11:14 PM
    6 responses
    205 views
    0 likes
    Last Post kenz987
    by kenz987
     
    Started by AaronKTradingForum, 04-28-2024, 02:37 PM
    5 responses
    52 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X