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

Value Differences when reading VWAP std deviation bands

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

    Value Differences when reading VWAP std deviation bands

    Whenever I use the following code in an indicator it pulls the correct values. Currently 7851.1 for the upper and 7836.27 for the lower. However, using the exact same code in a strategy it returns 7720.39 for the upper and 6487.99 for the lower.

    uppervalue = OrderFlowVWAP(VWAPResolution.Standard, TradingHours.String2TradingHours("CME US Index Futures ETH"), VWAPStandardDeviations.Three, 1.5, 2.5, 3.5).StdDev1Upper[1];
    lowervalue = OrderFlowVWAP(VWAPResolution.Standard, TradingHours.String2TradingHours("CME US Index Futures ETH"), VWAPStandardDeviations.Three, 1.5, 2.5, 3.5).StdDev1Lower[1];

    Any ideas on how to get the strategy to pull the correct values? It's almost like it is pulling the info from some point in the past. The strategy code checks BarsInProgress to be sure it is at 0 otherwise it just returns.

    Thanks

    #2
    Hello TradingOgre,

    Thanks for your post and welcome to the NinjaTrader forums!

    In the strategy, are you also adding the required 1 tick data series?

    If so, can you post your complete strategy code?

    If you would prefer not to post your complete code in the forum, you are welcome to write into PlatformSupport[a]NinjaTrader[dot]Com, attach your source code strategy file to the e-mail, mark the e-mail Atten:Paul and include a link to this thread for reference.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello TradingOgre,

      Thanks for your post and welcome to the NinjaTrader forums!

      In the strategy, are you also adding the required 1 tick data series?

      If so, can you post your complete strategy code?

      If you would prefer not to post your complete code in the forum, you are welcome to write into PlatformSupport[a]NinjaTrader[dot]Com, attach your source code strategy file to the e-mail, mark the e-mail Atten:Paul and include a link to this thread for reference.
      I am using standard resolution so tick data isn't required. However, I did add it to test and got the same results.

      now for the weird part.... I created a new strategy and only put in the two lines in my first post and two print statements and it pulls the correct values. So, something that I have in my original strategy is interfering with the values. The original strategy has some custom buttons along with a ton of other code so it could be anywhere. Oh well, the hunt is on.... LOL!

      Thanks for your help, I will post back here when/if I find anything.

      Comment


        #4
        Originally posted by TradingOgre View Post

        I am using standard resolution so tick data isn't required. However, I did add it to test and got the same results.

        now for the weird part.... I created a new strategy and only put in the two lines in my first post and two print statements and it pulls the correct values. So, something that I have in my original strategy is interfering with the values. The original strategy has some custom buttons along with a ton of other code so it could be anywhere. Oh well, the hunt is on.... LOL!

        Thanks for your help, I will post back here when/if I find anything.
        now it gets a bit more odd.... all I did was move the two lines of code from my first post up to near the beginning of OnBarUpdate() and now it pulls the correct values. I had it further down in the code near where I needed the information. Not sure why this would make a difference but it did and now it is working.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geddyisodin, Yesterday, 05:20 AM
        8 responses
        49 views
        0 likes
        Last Post geddyisodin  
        Started by DayTradingDEMON, Today, 09:28 AM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Stanfillirenfro, Today, 07:23 AM
        9 responses
        23 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by George21, Today, 10:07 AM
        0 responses
        8 views
        0 likes
        Last Post George21  
        Started by navyguy06, Today, 09:28 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X