Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running Sim Strategies

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

    Running Sim Strategies

    fdsfdsfdsfdsfds
    Last edited by spacebalts67; 07-02-2010, 09:12 AM.

    #2
    Hello,

    I am not sure. I suggest that you debug it to see why. This has not happened to anyone else, so I suspect the issue is within you strategy(s):


    Regarding the data issue, what are the data parameters you are using? Are you sure all instruments have data for the days you are using?
    DenNinjaTrader Customer Service

    Comment


      #3
      Hello,

      I can look at your log and trace files if you would like, to see if there is anything, but the best thing to do is to have me test the strategy and see if I can reproduce this issue. Or you can have a fellow trader friend test it on his machine if you perfer that. Please post your strategy so I can produce this.
      DenNinjaTrader Customer Service

      Comment


        #4
        spacebalts67,

        Just to be sure please ensure that the actual first starting bar of the chart is the same as it is in the chart tab of the Strategy Analyzer.

        An identical strategy running with identical parameters on an identical data set will produce identical results. These things need to be absolutely the same. What I suggest is you actually disconnect from your data feed to ensure that NinjaTrader does not go and retrieve new data and overwrite your old data set between your strategy runs.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          spacebalts67,

          First, you need to understand that backtesting and real-time are very different. http://www.ninjatrader-support.com/H...TimeVsBacktest

          Next, to see what is happening you would then need to debug your strategy in real-time with TraceOrders = true along with Print() to help evaluate your conditions. http://www.ninjatrader-support2.com/...ead.php?t=3627

          This would be the only way to evaluate what is going on under the hood.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            We have already reviewed your trace and logs and the way to proceed is for you to debug your strategy. I assure you NinjaTrader only makes trades when the code tells it to. If the code does not tell it to it will not trade. The only way you will know when the code justifies a trade is if you debug it. Unfortunately if you are unwilling to debug there is nothing more I can do on my end.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              spacebalts67,

              This is what I have been trying to convey to you. From all of the differences I have already stated and you insist on them not being the case I would not know. Your traces and logs do not contain information I can use to track it down and as such the only way to proceed is for you to debug it. Unfortunately there is just no other way.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                spacebalts67,

                I never implied I knew what your strategy is doing. This fact also makes it even harder for me to do anything. All you have provided me is trace and log information that only say that an order was placed and filled. This does not help in any way in determining why a strategy makes less trades in real-time.

                As stated, the only way to proceed is to debug. You need to see when your strategy evaluates conditions to true and when it does not. Only then can you qualify if the strategy should have traded or not. This is the fact of the matter. If you do not debug and see if the strategy should actually trade there is nothing further I can do.

                I assure you NinjaTrader will take trades when told to. Any inhibitors it may encounter will come up from debugging. I cannot assist you until you take the necessary steps in debugging your conditions and orders. Here are the links to debugging effectively again: http://www.ninjatrader-support2.com/...ead.php?t=3627
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I have already linked you to the article that discusses this. For your convenience, here it is again: http://www.ninjatrader-support.com/H...TimeVsBacktest

                  Please pay special attention to the "Running a Strategy at the Close of a Bar or Tick by Tick" section where it discusses CalculateOnBarClose.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    spacebalts67,

                    I have requested you to debug your code several times. Reason for this step is because it will reveal exactly how the strategy evaluates its conditions as well as exactly what your orders are doing. If you are unwilling to take this step I cannot assist you any further.

                    As far as your if (Historical) question goes, this is the behavior you will see if actually placed in the right place:
                    • With such a line in place all backtest results will be blank because none of your data is real-time data.
                    • With it in place in real-time, your strategy will effectively ignore all historical data on a chart and just process real-time data only. For sure it will not trade unless a real-time condition is evaluated to true.
                    Throughout this entire thread you insist you are getting backtest results and no real-time results. This behavior is not in line with the behavior I have outlined above and as such implies there is something wrong with your code. Since you are adamant you have it in the right place, to move forward I am again requesting you to debug. You assume there are other factors at play and for this precise reason you need to debug. From a debug you will be able to wash out exactly what prevents your orders from being placed, what is causing your orders to be ignored, and what your strategy is doing. With that information we can help you tweak your strategy or change any settings that may be impacting your strategy, but without that information there is nothing I can do.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      spacebalts67,

                      You do not need Visual Basic to do debugging. All you need to do to debug is use Print() throughout your code and read the output in the Output Window.

                      The only basic test you need to do is put a Print() inside your if-statements. This will output a line whenever your conditions are evaluated to true signifying a trade should have been placed here. If you never receive an output from this line it means that your conditions were never evaluated to true and no trades should have ever occurred. That is the very basic starting test to determine why you are not receiving orders in real-time.

                      Please keep in mind that your strategy will only evaluate real-time data with your if(Historical) segment in there. This means you have to have a cross occur on real streaming data. Just throwing your strategy onto a chart does not mean any of that data is real-time. In fact, all data preexisting on a chart are seen as historical data.

                      Code:
                      if (CrossAbove(ZeroLagStochs().Smoothed, LONG, 1)
                          && TSI(3, TSI1032)[0] > 0
                          && RSI(RSI1032, 3).Avg[0] > RSIL1032)
                      {
                          [B][COLOR=Red]Print(Time[0] + " ENTER LONG");[/COLOR][/B]
                          EnterLong(DefaultQuantity, "");
                      }
                      If you never receive this output line in your Output Window you know your condition is not true. You will then need to proceed into printing values of each of your conditions to find out which part of that compound condition is not true.
                      Code:
                      [B][COLOR=Red]Print(Time[0] + " CrossAbove: " + CrossAbove(ZeroLagStochs().Smoothed, LONG, 1) + " TSI Value: " + TSI(3, TSI1032)[0] + " RSI Value: " + RSI(RSI1032, 3).Avg[0] + " RSIL1032 Value: " + RSIL1032);[/COLOR][/B]
                      if (CrossAbove(ZeroLagStochs().Smoothed, LONG, 1)
                          && TSI(3, TSI1032)[0] > 0
                          && RSI(RSI1032, 3).Avg[0] > RSIL1032)
                      {
                          [B][COLOR=Red]Print(Time[0] + " ENTER LONG");[/COLOR][/B]
                          EnterLong(DefaultQuantity, "");
                      }
                      With those two simple print lines now you can evaluate your conditions by hand and know exactly when an order should have been placed.

                      If your conditions are all true at the exact same time and the "ENTER LONG" print was received yet you are still not able to receive any real-time orders then we can move on to the next step of debugging.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        The lines I provided should work. If you are having compile errors, please post the errors. There is no way we can just guess what they are.

                        To see the output, they will show up in the Output Window. Tools->Output Window.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          spacebalts67,

                          You will need to have the Output Window open the entire time for it to catch the Print() messages. Since you are trying to see what happens in real-time I suggest you maintain the if (Historical). You are trying to determine when your orders would be sent in real-time and it is just a matter of waiting for your Output Window to produce such a print.

                          If you remove the if (Historical) segment you will get prints throughout your historical data. This is no different than as if it were running in a backtest and would not be as useful for determining real-time behavior.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            spacebalts67,

                            We do not offer custom programming services. You are working with code and as such debugging is a reality for you. If you do not wish to do this I suggest you contact one of the 3rd party NinjaScript Consultants here who do offer such services: http://www.ninjatrader.com/webnew/pa...injaScript.htm
                            Josh P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Christopher_R, Today, 12:29 AM
                            0 responses
                            9 views
                            0 likes
                            Last Post Christopher_R  
                            Started by sidlercom80, 10-28-2023, 08:49 AM
                            166 responses
                            2,235 views
                            0 likes
                            Last Post sidlercom80  
                            Started by thread, Yesterday, 11:58 PM
                            0 responses
                            3 views
                            0 likes
                            Last Post thread
                            by thread
                             
                            Started by jclose, Yesterday, 09:37 PM
                            0 responses
                            8 views
                            0 likes
                            Last Post jclose
                            by jclose
                             
                            Started by WeyldFalcon, 08-07-2020, 06:13 AM
                            10 responses
                            1,415 views
                            0 likes
                            Last Post Traderontheroad  
                            Working...
                            X