Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Importing VWAP and Volume Profile plot into other indicator

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

    Importing VWAP and Volume Profile plot into other indicator

    1) I seem to remember that a second indicator can be attached to a primary indicator and that the primary indicator can access the plot values of the attached indicator...can someone point me to information on how to do this?

    2) is the entire plot available or just the last value?

    Thanks

    #2
    the reason is....I want to plot this data differently than the standard ... so I need the data in another indicator to do that plot...

    thanks

    Comment


      #3
      Hello llanqui,

      Thanks for your post.

      Are you referring to referencing the OrderFlowVWAP() indicator values within a custom NinjaScript indicator?

      If so, you could view the help guide documentation below to see sample code demonstrating how to access the OrderFlowVWAP() plot values:

      OrderFlowVWAP: https://ninjatrader.com/support/help...flow_vwap2.htm

      To access previous plot values you could supply a BarsAgo reference of 1 or more. BarsAgo 1 would reference the indicator value of the previous bar, for example.

      Note that the Order Flow Volume Profile indicator is not accessible in a custom NinjaScript. We are tracking interest in an existing feature request for supporting the use of Order Flow Volume Profile in NinjaScript. Please let me know if you would like me to add your vote to the feature request.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4

        Yes, to access the plot values from NinjaScript....

        and Yes, I would like to access the Volume Profile data from Ninjascript also





        Comment


          #5
          Hello llanqui,

          Thanks for your notes.

          Please see this help guide page for information about how to access Order Flow VWAP in NinjaScript: https://ninjatrader.com/support/help...flow_vwap2.htm

          I have added your vote to the feature request regarding supporting NinjaScript access for the Order Flow Volume Profile. This request is being tracked under the number SFT-3402.

          As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted on the Release Notes page of the Help Guide.

          Release Notes — https://ninjatrader.com/support/help...ease_notes.htm
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment


            #6
            In Ninja 7 there was a way to attach an indicator to another indicator....does that still exist in Ninja 8?

            the primary indicator could access the data of the attached indicator through the public variables of the attached indicator

            I never used it but it seemed to be valuable

            primarily I think it was intended to allow a strategy to instantiate an indicator

            ??

            Comment


              #7
              Hello llanqui,

              Thanks for your notes.

              Yes, it would be possible to pass an indicator as the input for another indicator.

              Please see this forum thread for information on this topic: https://forum.ninjatrader.com/forum/...64#post1161564
              <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

              Comment


                #8
                Hello ,

                I am working on a strategy MES , RangeBar (10 Ticks) based , and intend to call the OrderFlowVWAP() indicator . To learn , I did this using the examples provided by NT and received data for the Tick-Resolution ( after having added the AddDataSeries() -statement for ticks ok . But I failed when trying to add "AddDataSeries(Data.BarsPeriodType.Range, RangeSize);" . I did not receive a compiler error though , just the print message and the datapoint " 0 " for VWAPValue . Please confirm , if RangeBar are available to OrderFlowVWAP() through NTscript ( they print in the chart ) and if so, please let me share more background of my code to identify my issue and a solution ? :-) .

                Many thanks
                Lobo
                Last edited by Lobo_Trader; 09-29-2024, 03:30 PM.

                Comment


                  #9
                  Hello Lobo,

                  Yes, this would be possible.

                  The input series would be the BarsArray with the index of the range series, while the tick update would be on the BarsInProgress of the 1 tick series.

                  Let's say the range series was added first and the tick series added second.

                  The help guide example would be modified as such:

                  else if (State == State.Configure)
                  {
                  AddDataSeries(Data.BarsPeriodType.Range, 10);
                  AddDataSeries(Data.BarsPeriodType.Tick, 1);
                  }

                  // OnBarUpdate() logic
                  if (BarsInProgress == 1)
                  {
                  // Prints the VWAP value using a standard resolution off of RTH trading hours
                  double VWAPValue = OrderFlowVWAP(VWAPResolution.Standard, TradingHours.String2TradingHours("CME US Index Futures RTH"), VWAPStandardDeviations.Three, 1, 2, 3).VWAP[0];
                  Print("The current VWAP with a standard resolution on CME US Index Futures RTH is " + VWAPValue.ToString());

                  // Prints the first upper standard deviation value using a tick resolution off of trading hours of the Data Series
                  double VWAPStdDevUp1 = OrderFlowVWAP(VWAPResolution.Tick, Bars.TradingHours, VWAPStandardDeviations.Three, 1, 2, 3).StdDev1Upper[0];
                  Print("The current VWAP with a tick resolution on " + Bars.TradingHours.ToString() + " is " + VWAPStdDevUp1.ToString());
                  }
                  else if (BarsInProgress == 2)
                  {
                  // We have to update the secondary tick series of the cached indicator using Tick Resolution to make sure the values we get in BarsInProgress == 0 are in sync
                  OrderFlowVWAP(BarsArray[1], VWAPResolution.Tick, BarsArray[0].TradingHours, VWAPStandardDeviations.Three, 1, 2, 3).Update(OrderFlowVWAP(BarsArray[1], VWAPResolution.Tick, BarsArray[0].TradingHours, VWAPStandardDeviations.Three, 1, 2, 3).BarsArray[2].Count - 1, 1);
                  }
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    NinjaTrader_ChelseaB​ ...Chelsea , thank you very much for your response which was very helpfull . I am still working on this project and currently trying to add some variables to my code in order to be able set boundaries for arrays and to allow for optimisation settings for future strat development . One of those variables shall be the number of the ticks of the rangebar .

                    I found out , how my indicator can get the the number of ticks printed . This with the following piece of code :

                    HTML Code:
                    var bars = Bars;
                    var barsType = bars.BarsType;
                    Print($"BarsType: {barsType.Name}");
                    ​
                    and the output will be in this case : "BarsType: 16 Range Volumetric"

                    My task is now how to get hold of the number ( in this case "16" ) using code . I was looking at BarsPeriod() using "BarsPeriodType.Range​" but did not succeed . Or could I extract the number of the string .... if it is a string (barsType.Name) ?

                    Could you give me some guidance , please ?

                    Many thanks
                    Lobo
                    Last edited by Lobo_Trader; 11-02-2024, 12:15 PM.

                    Comment


                      #11
                      Hello,

                      You might be looking for BarsPeriod.Value or BarsPeriod.BaseBarsPeriodValue, which represents the period parameter.



                      Please let us know if this doesn't guide you in the right direction.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      580 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      336 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      103 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      554 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      552 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X