Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy run in chart or analyzer

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

    Strategy run in chart or analyzer

    Hello can i detect inside my strategy script, whether it is run from strategy analyzer or is added into chart? Is there any property telling me this?

    #2
    Hello Kujista,

    Thank you for your post.

    There is not a method to determine this. However, you can use the Historical check which would allow you to filter out historical data or not.

    if(Historical) return;

    This line will only run on live data that is coming in and would exclude any data for a backtest.

    http://www.ninjatrader.com/support/h...historical.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Historical data is something completely different. I use this property but i can use historical data and be on chart as well.. solves nothing... i thought you could come with with some chart toolbar or something like that existence..

      Comment


        #4
        Hello Kujista,

        There is no method to tell where the strategy is working from.

        The reason for the historical is that since the Strategy Analyzer is always historical data you can run that check. Since, when running on a chart you would have real time data coming in and the Historical check would be false at that point.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          I understood the point, I guess. It's just that I generate a lot of data when in "analysist" mode on historical data, and these data will be generated also when using strategy analyzer. So I am trying for a method to figure when these data should not be generated. Only silly method that comes to my mind is another parametry (true / false).

          Comment


            #6
            I needed to know this to avoid an error in Strategy Analyzer when doing an Override of DisplayName that included the Account.Name on the chart. I caused NT to crash in the SA so I'm doing a null check of Account. ( Account == null ? "SA" : Account.Name ) There may be situations where Account is null in the Strategy but seeing as an Account has to be selected to enable it I don't see why it would be.

            Comment


              #7
              Hello ctrent,

              Thanks for your notes.

              To clarify, this is an old forum thread for NinjaTrader 7 which does not have an Account class available and does not have the the DisplayName override for names of scripts that appear on the chart.

              These are NinjaTrader 8 features.

              NT8 Account Class: https://ninjatrader.com/support/help...ount_class.htm
              NT8 DisplayName: https://ninjatrader.com/support/help...isplayname.htm

              If you have a NinjaTrader 8 question regarding this topic, please post a new thread in the NinjaTrader Desktop > General Development section of the forums and we will be happy to assist you.
              Brandon H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Aviram Y, Today, 05:29 AM
              0 responses
              2 views
              0 likes
              Last Post Aviram Y  
              Started by quantismo, 04-17-2024, 05:13 PM
              3 responses
              25 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by ScottWalsh, 04-16-2024, 04:29 PM
              7 responses
              34 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by cls71, Today, 04:45 AM
              0 responses
              6 views
              0 likes
              Last Post cls71
              by cls71
               
              Started by mjairg, 07-20-2023, 11:57 PM
              3 responses
              216 views
              1 like
              Last Post PaulMohn  
              Working...
              X