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

AddVolumetric() to Strategy

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

    AddVolumetric() to Strategy

    I am trying to GetMaximumVolume on Range bars for my strategy. I can AddVolumetric and compile but when I enable the strategy it throws an 'unhandled exception' error. I found note 6 from the AddVolumetric() help page . . . .

    "A Tick Replay indicator or strategy CANNOT use a MarketDataType.Ask or MarketDataType.Bid series. Please see Developing for Tick Replay for more information."

    I think this is telling me it is not possible to AddVolumetric to a strategy. Is that true? I looked at the "Strategy Builder". There is no option to AddVolumetric there either. The absence of this option in the builder seems to confirm it is not possible.

    Question: how can I get this information into my strategy?

    p.s. I'm thinking to create an indicator with AddVolumetric that produces a bool when my trade condition is true. I can read the indicator bool to trigger a trade in the strategy. But . . . this is very inefficient.

    #2
    Hello,

    Below is a link to the help guide on using the Volumetric bars once they have been added to the script.


    Are you looking for:
    Print("Max seen delta (bar): " + barsType.Volumes[CurrentBar].MaxSeenDelta);


    With the message:
    "A Tick Replay indicator or strategy CANNOT use a MarketDataType.Ask or MarketDataType.Bid series. Please see Developing for Tick Replay for more information."

    Are you adding series with AddDataSeries() that use MarketDataType.Ask or MarketDataType.Bid and actually getting this error?
    If so, that unfortunately will not be possible when using AddVolumetric().


    This does not mean you cannot add AddVolumetric() to an unlocked strategy. This just means you can't add this and then add series with MarketDataType.Ask or MarketDataType.Bid as well. You can only add AddVolumetric() and you can add series with AddDataSeries() that use MarketDataType.Last.

    The Strategy Builder is limited to very simple scripts and cannot use Order Flow bar types or indicators. Using Order Flow in NinjaScript is advanced and requires unlocking the script and coding by hand.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you @NinjaTrader_ChelseaB. This is helpful.

      I'm using straight up AddVolumetric() only. I am trying to access "Maximum Combined" using " barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price)". I am not trying to also AddDataSeries() in addition or access MarketDataType.Ask or MarketDataType.Bid.

      I guess the error is coming from some other place in my code. I'll keep looking.

      Comment


        #4
        Hello kafabla,

        Are you confirming this script is causing the error 'A Tick Replay indicator or strategy CANNOT use a MarketDataType.Ask or MarketDataType.Bid series. Please see Developing for Tick Replay for more information.', on the Log tab of the Control Center, when this specific script is enabled?

        May we see the code in OnStartUp()? (All of the code in OnStartUp())
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          @NinjaTrader_ChelseaB. No, I am not confirming any problems with NinjaScript. I found the problem. It turned out to be oversight on my part. I was not referencing the correct BarsInProgress.

          All is well. Again, thank you. I appreciate your quick and thorough response.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Aviram Y, Today, 05:29 AM
          0 responses
          3 views
          0 likes
          Last Post Aviram Y  
          Started by quantismo, 04-17-2024, 05:13 PM
          3 responses
          27 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          7 responses
          35 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by cls71, Today, 04:45 AM
          0 responses
          6 views
          0 likes
          Last Post cls71
          by cls71
           
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          218 views
          1 like
          Last Post PaulMohn  
          Working...
          X