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

Keeping value when refresh

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

    Keeping value when refresh

    How do I keep the value from changing when user hits refresh or adds another indicator?

    Additionally, how do I get open position unrealize pnl from multiple instrument using the indicator?

    #2
    Hello AldricJC,

    Thank you for your post.

    What value is changing? Is this the plot?

    You can use Position.GetProfitLoss() for the strategy's position: http://www.ninjatrader.com/support/h...profitloss.htm

    Comment


      #3
      Originally posted by AldricJC View Post
      How do I keep the value from changing when user hits refresh or adds another indicator?

      Additionally, how do I get open position unrealize pnl from multiple instrument using the indicator?
      When you refresh a chart, real-time data is replaced with historical data. In case that an indicator value changes after a refresh, there can be different reasons:

      (1) historical data (backfill) is different from real-time data

      This is for example the case if you feed volume indicators with volume data from Interactive Brokers. The real-time volume they supply is just estimated volume (and in fact completely false). When you refresh this volume data is replaced with (mostly correct) historical data. Any volume based indicator, such as a VWMA or a VWAP will change its value.

      (2) badly coded indicators

      Some indicators perform calculations in a different way when used with real-time data compared to the way they work with historical data. In fact many indicators that you can download for free a flawed in some way or another. Before you use any unknown indicators with you charts, you need to perform a test, whether they work correctly.

      Comment


        #4
        I noticed this about VWAP even though I have CQG data. Why is the real-time volume data "false?" BEFORE and AFTER I F5, the volume as reported in the data-box remains unchanged even though the VWAP plot (on a minute chart) changes. It doesn't seem that the volume is false, it seems that the indicator is "false."

        Comment


          #5
          Originally posted by ScorpioTravis View Post
          I noticed this about VWAP even though I have CQG data. Why is the real-time volume data "false?" BEFORE and AFTER I F5, the volume as reported in the data-box remains unchanged even though the VWAP plot (on a minute chart) changes. It doesn't seem that the volume is false, it seems that the indicator is "false."
          Which VWAP do you use?

          Did you try this one?

          The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies

          Comment


            #6
            Originally posted by Harry View Post
            Which VWAP do you use?

            Did you try this one?

            https://www.bigmiketrading.com/downl...load.html?view
            No, and I'm not an Elite member.

            Apparently it doesn't have the refresh issue?
            Last edited by ScorpioTravis; 12-12-2014, 04:17 PM.

            Comment


              #7
              Originally posted by ScorpioTravis View Post
              No, and I'm not an Elite member.

              Apparently it doesn't have the refresh issue?
              Send me a private message with your e-mail, and I will send you the indicator. Which VWAP did you use?

              Comment


                #8
                Originally posted by Harry View Post
                Send me a private message with your e-mail, and I will send you the indicator. Which VWAP did you use?
                To be honest, I don't remember, But I think it was from NT forum.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sidlercom80, 10-28-2023, 08:49 AM
                167 responses
                2,260 views
                0 likes
                Last Post jeronymite  
                Started by warreng86, 11-10-2020, 02:04 PM
                7 responses
                1,362 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Perr0Grande, Today, 08:16 PM
                0 responses
                5 views
                0 likes
                Last Post Perr0Grande  
                Started by elderan, Today, 08:03 PM
                0 responses
                9 views
                0 likes
                Last Post elderan
                by elderan
                 
                Started by algospoke, Today, 06:40 PM
                0 responses
                10 views
                0 likes
                Last Post algospoke  
                Working...
                X