Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

VWMA plot pre and after "Reload Ninja script"

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

    VWMA plot pre and after "Reload Ninja script"

    hi,

    I run a strategy based on the VWMA indicator on futures (ES etc.). I have enabled plot so I can see the indicator on the chart as the strategy runs. The resolution is 1-sec and the chart style "Line on Close". The problem is that after a while the indicator line plot is getting way off the line plot of the closing price of the future. When I Reload the Script the chart changes again. Please see the relevant attachments (pre & after).
    This phenomenon affects my strategy and I need to constant reload the script to allow this to run as planned. Do you know why this happens? The future plot is based on close price and the indicator is calculated based on ask/bid price.

    thanks
    Attached Files

    #2
    Hello space_trader,

    Thank you for your post.

    So that I may best test on my end, would you be able to provide a screenshots of the VWMA settings from within your strategy? Specifically where you're calling the VWMA and adding it to your chart?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      hello,

      Attached the 2 conditions used in the strategy.

      Attached Files

      Comment


        #4
        Hello space_trader,

        Thank you for your reply.

        I believe the odd behavior you're seeing stems from running the strategy OnPriceChange, as I am seeing a similar effect when using that Calculate mode and the indicator prints a message stating it expects to be run OnEachTick or OnBarClose. Indicators will automatically use the same calculation mode as the strategy that calls them. If you run the strategy OnEachTick or OnBarClose, do you see the VWMA calculating as expected?

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Ok, I see your point. I changed the strategy to run OnEachTick and OnBarClose but didn't make any actual change. In fact, I would like to point out another odd behavior I am sometimes getting (attached capture (before) and capture2 (after)). Let me elaborate a bit, based on what you mentioned. So, the plot is based on DataSeries -> Price Based On: Last. But the strategy considers Bid and Ask prices. Do you think this creates a conflict? I could change the plot DataSeries too, in order to match the strategy settings but then I would need 2 plots since the strategy uses both Bid and Ask. And I can only select one type of DataSeries on the plot. I will try to use 2 panels of the same plot for Bid and Ask and see if that works.
          thanks
          Attached Files

          Comment


            #6
            Forgot to mention my data feed is Kinetick.

            Comment


              #7
              Last thing, I just noticed that it is not enough to change the settings in Strategy Builder. You also need to change the settings (OnBarClose etc.) in the control center so my previous runs might still be with the old settings and what I wrote isn't valid. I made the changes and I will try again.

              Comment


                #8
                Hello space_trader,

                Thank you for your replies.

                It is best practice to completely remove the strategy instance from the Control Center Strategies tab or Chart you are testing the strategy on when you have made changes to the code as some changes will not be noticed from an older instance.

                On Historical Data bid/ask will be replaced by the Close price unless your strategy is specifically set up to get historical bid/ask using Tick Replay which cannot be done in the builder. The indicator itself calculating using Last will not be affected but your results will vary between live and historical (for example, in a backtest in the Strategy Builder.

                I am not able to replicate this when calling the indicator from a strategy when using OnEachTick or OnBarClose. If you remove and readd the strategy once you've changed that in the code, do you see the VWMA plot correctly?

                Please let us know if we may be of further assistance to you.
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  hi Kate,

                  I run it again with the right settings this time and it seems that this was the problem. All good now. Thanks a lot for your help!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Working...
                  X