Announcement

Collapse
No announcement yet.

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.

    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 NullPointStrategies, Today, 05:17 AM
        0 responses
        25 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        121 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X