Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Enable Strategy Analyser on Strategy

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

    How to Enable Strategy Analyser on Strategy

    I have developed a strategy which work on both the NT 'Replay' and Simulator, but doesn't seem to executve any trades not output anything to the 'Output Window'... which basically means it's not running.

    Is there something special I need to do in the code?, a flag?, or a setting somewhere?

    #2
    Hello,

    Thank you for your note.

    Can you please clarify are you trying to run this straregy live or in the strategy analyzer?

    In this strategy are you using any if(Historical) checks or ATMStrategies as this would not allow the strategy to run in the Strategy Analyzer.

    Also, please insure you have data for the instrument you are trying to test.

    I look forward to assisting you further.

    Comment


      #3
      Thanks for your reply! I am using the "strategy analyzer".. I am not doing any historical analysis. My strategy is completely NJ script based... It monitors onbarupdate, onorderupdate and places orders using SubmitOrder/Cancel Order.

      Thanks!
      Chris

      Comment


        #4
        Addionallty I downloaded the data for the interment using Dowload Replay Data and am connected to Replay. I have ran the same code on this instrument in Replay mode...

        The chart tab in Strategy Analyser does show data.

        Chris
        Last edited by cjwallac; 01-14-2011, 09:47 AM.

        Comment


          #5
          Hello,

          So you just have access to the downloaded replay data, your not connected to a live data feed provider?

          I look forward to assisting you further.

          Comment


            #6
            I have a eSingal connection, I we were looking to use this for backtesting... Should I be connected to esginal?

            Comment


              #7
              When connected to esignal I get output to the output window, bit it seems onbarupdate doesn't get executed on each tick.. Is this the issues?

              Comment


                #8
                Hello,

                The strategy analyzer is only for running on historical data.

                Also, The reply data is not historical data, you must be connected to eSignal for historical data.

                Also, to calculate on each tick in the strategy analyzer since the strategy analyzer only runs on the OHLC of the chart its run on not tick by tick. To get it to run in this mode you have to add instrabar granularity.

                You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


                Also, how a strategy backtest can be different:



                Let me know if I can be of further assistance.

                Comment


                  #9
                  So I added:
                  "Add(PeriodType.Tick, 1);"

                  Which per my understand would add a one tic data series then

                  potected override void OnBarUpdate(){

                  if (BarsInProgress == 1)
                  {
                  //code there base on
                  double point = Bars.LastPrice;

                  }

                  }

                  It seems that OnBarUpdate is not getting called every tick and only at the end of the backtest... Am I correct?

                  So for my to monitor the ticks based in OnBarUpdate() in Strategy Analyser is not possbile?

                  I have this working perfectly in Simulation and Market Replay...

                  Sorry, but I am missing something?

                  You help is greatly apreciated!

                  Comment


                    #10
                    Hello,

                    No this should not be the case it would be added it.

                    Please verify you have tick data however. Most likely you dont hve the tick data you need. If I remember correctly eSignal only supports 10 days of tick data.

                    Let me know if I can be of further assistance.

                    Comment


                      #11
                      I ran on last 10 days and it seems that the tick data does exist, but the onbarupdate() doesn't get fired for each tick? It seems that is on gets called on the last day on the close?

                      The chart in strategy analyst shows the tick data!

                      Do I need to code the this? Meaning should I not be using Bars.LastPrice and instead lopping through ALL the bar data each time OnBarUpdate gets fired on the last day? To me it seems on the close of the last day it gets fired for each tick... So Bars.LastPrice value is always be the close of the last day when onbarupdate() is called.

                      Thanks for your help!!

                      Chris
                      Last edited by cjwallac; 01-17-2011, 08:25 AM.

                      Comment


                        #12
                        Hello,

                        This should work, at this point in time. I'm going to need to look into your strategy to see what is possibly off.

                        Please send this to support at ninjatrader dot com. Reference this forum thread and put ATTN: Brett in the subject line.

                        I look forward to assisting you further.

                        Comment


                          #13
                          Hello,

                          Also, just to reclarify you still run the strategy test on the original bars you did before. The tick chart and series to run on in the background will be loaded in the background. You wont be able to see this chart.

                          Comment


                            #14
                            Brett understood! I sent you the files... Thanks for your help!! I am making my assupmtion based on the Output Window and No Traded being executed.

                            Comment


                              #15
                              Hello,

                              The issue I see here is that you added everything in the BarInProgress == 1 check. This will only allow all your code to run on the Secondary data series which would be the tick series.

                              Which is not want you want considering that your strategy does not process any trades while running on a tick chart.

                              You want to have everything run on the original time frame you build the strategy on. This would be your BarsInProgress == 0 is what you want to use here.

                              Then instead of EnterLong() in the BarsInProgress == 0 which will only be on the OHLC of the input data series. You would instead set a flag to go long.

                              Then add another seperate section of code for your if(BarsInProgress == 1) check.

                              Let me know if I can be of further assistance.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Kaledus, Today, 01:29 PM
                              5 responses
                              12 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by Waxavi, Today, 02:00 AM
                              1 response
                              8 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Started by alifarahani, Today, 09:40 AM
                              5 responses
                              23 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by gentlebenthebear, Today, 01:30 AM
                              3 responses
                              16 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by PhillT, Today, 02:16 PM
                              2 responses
                              7 views
                              0 likes
                              Last Post PhillT
                              by PhillT
                               
                              Working...
                              X