Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy shows only last trade

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

    Strategy shows only last trade

    Hi there. I am having a problem for last couple of days. When I create strategy in NT8 and enable it in chart. It only shows one last trade - the last trade of the whole chart. Let's say I have 500 days loaded in chart - so the only visible trade made was on the day 500 and even the condition were met several times during this day only last trade is shown.

    I am trying to find solution for this issue but with no luck.

    Thank you for your help

    #2
    Hello djr_trader,

    Thanks for your first post on the NinjaTrader forums!

    Please provide further information:

    1) What version of NinjaTrader8 are you using? (Look in Help>About)
    2) How are you testing the strategy? On a live chart or, on market replay or, on the Strategy analyzer?
    3) Did you create the strategy? If so did you create in the Strategy builder or using Ninjascript?
    4) Please test on the same data with the strategy SampleMACrossover provided with your NinjaTrader and advise your results (in terms of were there trades over the duration of the test period).
    5) On your strategy, after you have applied it to a chart and only 1 trade is shown on the chart, please right mouse click on the chart and select StrategyPerformance>Historical, does this report show any trades?


    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi there, thank you for your reply. Here are the answers.

      1, 8.0.21.1 64-bit
      2, I am using live chart with historical data loaded.
      3, Yes I created the strategy, it is only simple strategy just to give me heads up if my conditions are met. The strategy just print an arrow when CCI crosses. I did use Strategy builder for this. I have created strategies like this before but with no problem.
      4, SampleMACrossover works just fine with no problem.
      5, My strategy only show an arrow, there is no trade.

      Thank you, it would help me considerably to solve this problem as I am trying to see multiple charts.

      Comment


        #4
        Hello djr_trader,

        Thanks for your reply.

        Can you clarify if the strategy uses entry methods to place orders or is its current purpose to just draw arrows and you are wondering why you only see the latest arrow?

        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello,
          I read this article that has an issue like mine but not exactly the same. Let's describe it:

          - I manually coded a strategy that have, let's say, 4 'if' conditions that each have a Draw.Arrow function to identify the place on the chart where the condition is met and each Draw.Arrow function have a different name (let's say: 1-2-3-4)
          - At different time where each conditions are met, the arrows are well represented on the chart. In fact, all the code works well.

          The problem occurs when a same condition happens for a second time. When the condition 1 is met a second time (one hour later, by example), the first condition 1 arrow that was drawn 1 hour ago is erased and the new condition 1 is drawn at the right place. I'd really like the first arrow (drawn 1 hour ago) or all others to stay drawn so that I could see all signals my code generated and not only the last one of each condition.

          This happen in live trading chart as well as in playback mode.

          Hope this explanation is enough detailed.

          NT8 / Win10-64

          Thank you very much for you support.

          Comment


            #6
            Hello Bricolico,

            Thanks for your post.

            What you are describing would be expected because all draw methods use a "tag name". There can only be one tag name on the chart, so when you reuse the tag name the first object is removed and the new (latest) object is drawn.

            If you would like to see all of the draw objects that use the same tag name, you would need to make each tag name unique. The easiest way to do that would be to add the current bar number to the tage name. For example "test"+CurrentBar.

            CurrentBar is the system bar counter, as each bar is added to the chart, this number increases. Reference: https://ninjatrader.com/support/help...currentbar.htm
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hello PaulH and thanks for your fast answer.

              I thought about something like this but I thought at first I could have checked a box somewhere so it could solve my problem but your suggestion is fine to me. I'll change my few lines of code.

              Many thanks. Have a nice week-end!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 02:12 AM
              5 responses
              23 views
              0 likes
              Last Post rocketman7  
              Started by trilliantrader, 04-18-2024, 08:16 AM
              7 responses
              28 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by samish18, 04-17-2024, 08:57 AM
              17 responses
              66 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by briansaul, Today, 05:31 AM
              1 response
              15 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by PaulMohn, Today, 03:49 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X