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 volumetric dataseries

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

    strategy volumetric dataseries

    Hello,

    comparing using volumetric dataseries for bidask-analysis and OFcumulativeDelta I want to ask please if my understanding is correct that
    when running a script-strategy in a chart with volumetric dataseries as primary dataseries of the chart one has not to add volumetric in state.configure?

    Compared to OFcumulativeDelta that has to be added in state.configure with 1 Tick even when using it on the dataseries of the chart. But what if OFcumulativeDelta should be calculating with another dataseries? eg one trades the MNQ but the OFcumulativeDelta should be calculating in the script with NQ? Is it correct to have in state.configure AddDataSeries("NQ 03-20", BarsPeriodType.Tick, 1);?
    Is it then correct to have in state.dataloaded referring to state configure AddDataSeries("NQ 03-20", BarsPeriodType.Tick, 1):
    OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Closes[1], NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);

    (this is not clear from the sample in the helpguide because there is only the primary dataseries)

    Thank you!
    Tony
    Last edited by tonynt; 01-22-2020, 08:03 AM. Reason: clearifying question

    #2
    Hello tonynt,

    Thanks for your post.

    "...when running a script-strategy in a chart with volumetric dataseries as primary dataseries of the chart one has not to add volumetric in state.configure?" Correct, however with reference to the example in the help guide, the example shows that when the Volumetric bars are the chart bars, you would only need to add (In OnBarUpdate()):
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

    Reference: https://ninjatrader.com/support/help...tric_bars2.htm

    Regarding, "Compared to OFcumulativeDelta that has to be added in state.configure with 1 Tick even when using it on the dataseries of the chart. But what if OFcumulativeDelta should be calculating with another dataseries? eg one trades the MNQ but the OFcumulativeDelta should be calculating in the script with NQ? Is it correct to have in state.configure AddDataSeries("NQ 03-20", BarsPeriodType.Tick, 1);?
    Is it then correct to have in state.dataloaded referring to state configure AddDataSeries("NQ 03-20", BarsPeriodType.Tick, 1):
    OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Closes[1], NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);"
    You would need to add the NQ bars that you want the cumulative delta of AND add the NQ 1 tick series to support the indicator. So with reference to your example, lets assume you have a chart of 1 minute MNQ. In the code you would add a 1 tick series of MNQ for the indicator. Lets further assume you want the 1 minute NQ, so you would also have to add 1 minute NQ and 1 tick series of NQ. This means you would be adding 3 data series to your script. The help guide shows the syntax for the indicator as:
    Syntax:
    OrderFlowCumulativeDelta(CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter)
    OrderFlowCumulativeDelta(ISeries<double> input, CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter)


    This is showing that you can use the 2nd overload method that allows you to specify the input data series which would be the NQ 1 minute bars.

    In the OnBarUpdate(), as the example in the help guide shows, you would need to segment by the bars in progress to then update each of the two uses (in this example).

    Reference: https://ninjatrader.com/support/help...ive_delta2.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mokaru Zen, Today, 01:20 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by dgee949, Yesterday, 06:26 PM
    1 response
    38 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by dgee949, Yesterday, 05:58 PM
    1 response
    40 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by papaoutai, Yesterday, 08:56 AM
    1 response
    42 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by grzltn, Today, 02:18 AM
    0 responses
    21 views
    0 likes
    Last Post grzltn
    by grzltn
     
    Working...
    X