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

TradingHours -> OrderFlowVWAP

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

    TradingHours -> OrderFlowVWAP

    Hi,

    I want to use the 'OrderFlowVWAP' indicator in my indicator. And I want to add the 'OrderFlowVWAP''s input parameters in my indicator input parameters. However, I do not understand how to create the 'TradingHours' correctly. Please take a look, this is what I want to see in 'OrderFlowVWAP' Indicator:
    Click image for larger version

Name:	image.png
Views:	81
Size:	75.1 KB
ID:	1279063

    However, in my Indicator I see just this:
    Click image for larger version

Name:	image.png
Views:	74
Size:	11.0 KB
ID:	1279064Click image for larger version

Name:	image.png
Views:	76
Size:	12.2 KB
ID:	1279066

    As you can see - this is not a drop down menu. This is looks loke a string value. I cannot choose anything.

    Question:
    How can I create the TradingHours correctly?
    Attached Files

    #2
    Hello webus,

    Thanks for your post.

    Please see the forum thread below demonstrating how to create a TradingHours drop-down menu user-defined property.

    Is there any way I can have a trading hours template as an Input to an indicator. So that when I add it to a chart, I can have a dropdown list of Trading
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_BrandonH​,

      Originally posted by NinjaTrader_BrandonH View Post
      Hello webus,

      Thanks for your post.

      Please see the forum thread below demonstrating how to create a TradingHours drop-down menu user-defined property.

      https://forum.ninjatrader.com/forum/...15#post1036915
      Thanks, but please take a look:

      Code:
      protected override void OnStateChange()
      {
         if (State == State.SetDefaults)
         {
            tradingHours = TradingHours.Get("CME FX Futures ETH");
         }
      }​
      As you can see - the trading hours are specified for "CME FX Futures ETH" by default. How can I specify <Use data series settings> instead by default?
      Click image for larger version

Name:	image.png
Views:	72
Size:	22.4 KB
ID:	1279086

      Comment


        #4
        Hello webus,

        Thanks for your notes.

        Setting to TradingHours drop-down input property to "<Use default settings>: would not be possible to accomplish.

        To clarify, what exactly will be the use case for adding a TradingHours user-defined property in the script?

        For example, if you are trying to create a user-defined input to use for AddDataSeries() calls in the script, this would not be supported. AddDataSeries() arguments must be hardcoded in the method as noted in the help guide.

        From the help guide: "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided."

        AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm

        Something you could consider is to leave the default as null, check if the value is null, and then use the BarsArray[0].TradingHours when null.

        Here is a forum thread on this topic which you might find helpful: https://forum.ninjatrader.com/forum/...104#post758104
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi NinjaTrader_BrandonH​,​

          Originally posted by NinjaTrader_BrandonH View Post
          Hello webus,

          Thanks for your notes.

          Setting to TradingHours drop-down input property to "<Use default settings>: would not be possible to accomplish.

          To clarify, what exactly will be the use case for adding a TradingHours user-defined property in the script?

          For example, if you are trying to create a user-defined input to use for AddDataSeries() calls in the script, this would not be supported. AddDataSeries() arguments must be hardcoded in the method as noted in the help guide.

          From the help guide: "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided."

          AddDataSeries(): https://ninjatrader.com/support/help...dataseries.htm

          Something you could consider is to leave the default as null, check if the value is null, and then use the BarsArray[0].TradingHours when null.

          Here is a forum thread on this topic which you might find helpful: https://forum.ninjatrader.com/forum/...104#post758104

          As I wrote earlier - I want to use the 'OrderFlowVWAP' indicator in my Indicator. And I want to share the 'OrderFlowVWAP' input parameters in my indicator's input paramters. As I can see - in 'OrderFlowVWAP' indicator the TradingHours by default are <Use data series settings>. Please take a look at the screenshot below (you can also start the 'OrderFlowVWAP' on your side) -> so it is possible to specify <Use data series settings>. My question is 'how'?
          Click image for larger version

Name:	image.png
Views:	71
Size:	29.1 KB
ID:	1279110

          Comment


            #6
            Hello webus,

            Thanks for your notes.

            Setting to TradingHours drop-down input property to "<Use default settings>" in a custom NinjaScript would not be possible to accomplish.

            You could consider following the advice mentioned in post # 4 in your script. See the forum thread linked in post # 4 for more information.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,404 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            95 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            159 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X