Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Flow VWAP

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

    Order Flow VWAP

    Hi all,


    I.m trying to develop a strategy with the OrderFlowVWAP indicator. And i.m reading the documentation in the wiki:

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

    But when i try the code on VISUAL STUDIO 2019 , it doesn.t work:

    Code:
    double VWAPValue = OrderFlowVWAP(VWAPResolution.Standard, TradingHours.String2TradingHours("CME US Index Futures RTH"), VWAPStandardDeviations.Three, 1, 2, 3).VWAP[0];
    It doesn.t recognize the function "OrderFlowVWAP(.........)". How can i use this indicator ? I recently upgrade my license and i have a full life time license.


    King regards,
    Last edited by Wargos; 07-29-2020, 11:36 AM.

    #2
    Hello Wargos,

    Thank you for the post.

    What is the specific error that you are seeing?

    I would otherwise suggest to attach the script you are using so that I can review the structure of the script and using statements. The indicator should be able to be used by using the sample from the help guide you linked to.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      The problem is that the code work when i use the NinjaScript Editor. But when i open the solution on Visual Studio, it doen.t recognice the line:

      Code:
       
       double VWAPValue = OrderFlowVWAP(VWAPResolution.Standard, TradingHours.String2TradingHours("CME US Index Futures RTH"), VWAPStandardDeviations.Three, 1, 2, 3).VWAP[0];
      Full code:

      Code:
      #region Using declarations
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.ComponentModel.DataAnnotations;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Gui;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Gui.SuperDom;
      using NinjaTrader.Gui.Tools;
      using NinjaTrader.Data;
      using NinjaTrader.NinjaScript;
      using NinjaTrader.Core.FloatingPoint;
      using NinjaTrader.NinjaScript.Indicators;
      using NinjaTrader.NinjaScript.DrawingTools;
      #endregion
      
      //This namespace holds Strategies in this folder and is required. Do not change it. 
      namespace NinjaTrader.NinjaScript.Strategies
      {
          public class VWAP21 : Strategy
          {
              protected override void OnStateChange()
              {
                  if (State == State.SetDefaults)
                  {
                      Description                                    = @"Enter the description for your new custom Strategy here.";
                      Name                                        = "VWAP21";
                      Calculate                                    = Calculate.OnEachTick;
                      EntriesPerDirection                            = 1;
                      EntryHandling                                = EntryHandling.AllEntries;
                      IsExitOnSessionCloseStrategy                = true;
                      ExitOnSessionCloseSeconds                    = 30;
                      IsFillLimitOnTouch                            = false;
                      MaximumBarsLookBack                            = MaximumBarsLookBack.TwoHundredFiftySix;
                      OrderFillResolution                            = OrderFillResolution.Standard;
                      Slippage                                    = 0;
                      StartBehavior                                = StartBehavior.WaitUntilFlat;
                      TimeInForce                                    = TimeInForce.Gtc;
                      TraceOrders                                    = false;
                      RealtimeErrorHandling                        = RealtimeErrorHandling.StopCancelClose;
                      StopTargetHandling                            = StopTargetHandling.PerEntryExecution;
                      BarsRequiredToTrade                            = 20;
                      // Disable this property for performance gains in Strategy Analyzer optimizations
                      // See the Help Guide for additional information
                      IsInstantiatedOnEachOptimizationIteration    = true;
                  }
                  else if (State == State.Configure)
                  {
                  }
              }
      
              protected override void OnBarUpdate()
              {
      
                  double VWAPValue = OrderFlowVWAP(VWAPResolution.Standard, TradingHours.String2TradingHours("CME US Index Futures ETH"), VWAPStandardDeviations.Three, 1, 2, 3).VWAP[0];
                  Print("The current VWAP with a standard resolution on CME US Index Futures RTH is " + VWAPValue.ToString());
      
              }
          }
      }

      Comment


        #4
        Hello Wargos,

        Thank you for clarifying that.

        Visual studio does not have intellesense for this indicator as it is not included as source code so what you are seeing is correct. It will still compile it is just not able to pull that from the NinjaTrader custom project.

        You can manually include the NinjaTrader.Vendor.cs file in the visual studio solution however it will be removed every time you make changes in the ninjascript project.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I.m trying but still doesn.t compile on Visual Studio.The error i get is:

          CS1955 C# Non-invocable member cannot be used like a method.

          Comment


            #6
            Hello Wargos,

            Visual studio will not be able to compile in any use case, it is just being used as a text editor here. If the platform compiles in the NinjaScript editor then the syntax would be correct.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by EB Worx, Today, 02:09 PM
            0 responses
            3 views
            0 likes
            Last Post EB Worx
            by EB Worx
             
            Started by Revazi123, Today, 01:01 PM
            0 responses
            9 views
            0 likes
            Last Post Revazi123  
            Started by sushilake, Today, 12:21 PM
            0 responses
            5 views
            0 likes
            Last Post sushilake  
            Started by AaronKoRn, Today, 10:17 AM
            0 responses
            7 views
            0 likes
            Last Post AaronKoRn  
            Started by PWillard, Today, 10:02 AM
            0 responses
            7 views
            0 likes
            Last Post PWillard  
            Working...
            X