Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SA not changing date

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

    SA not changing date

    I ran 3 nov in SA Optimizer...no problem

    I then changed date to 11 nov and it ran 3 nov again....does not matter which date I put in, it still runs 3 nov

    only way to get it to change is to change instruments from YM 12-08 YM to YM 09-08 to run 8 aug...no problem

    then try to change back to YM 12-08 to run 11 nov and I still get 3 nov.....

    #2
    I can run 29oct and it plots the chart and list the data...however the date in the title bar still says 3 nov

    I can not run any of the other days in nov without getting the chart and data for 3 nov

    Comment


      #3
      Hello,

      Is this the from or the to date?

      I can't reproduce this. I am able to change the from and to dates in the optimizer and they save the last date I ran each time. This is the expected behavior.
      DenNinjaTrader Customer Service

      Comment


        #4
        from and to dates are both set to the same date...i.e. only running one day

        i traced the problem to having MarketReplay open in another workspace...it was set to 3 nov and so every time i tried to run a nov date, SA was giving me 3 nov

        so...with MR off...I can run all dates (one at a time) except 11 nov... <-- problem 1

        problem 2 --> i can only get SA to run the first day if I try for a whole week...for instance running 3 nov thru 7 nov it only executes for 3 nov...this could be my strategy...will try with sampleatmstrategy and report

        Comment


          #5
          sampleatmstrategy does not optimize without adding some parameters

          question: does SA not work with AtmStrategyCreate etc.?

          I had to add code :

          SetTrailStop(CalculationMode.Ticks, StrategyAnalyzerTrail );
          entryOrder = EnterShort();

          etc..in order to get SA to make trades

          Comment


            #6
            Hello,


            For post #4 please provide the exact steps you are taking so I can reproduce this behavior. Please do it with SampleMACrossOver.

            For post #5, this is because this strategy has if(Historical) return; in OnBarUpdate(). This strategy is not meant for backtesting or optimizing.
            DenNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Ben View Post
              Hello,


              For post #4 please provide the exact steps you are taking so I can reproduce this behavior. Please do it with SampleMACrossOver.
              1. start NT...open a workspace with 2 charts....start MarketReplay for 3 nov

              2. close workspace but not MR

              3. open workspace for strategy analyzer (nothing running but SA...ie. no charts)

              4. optimize YM 12-08 contract for 3 nov to 3 nov...change one parameter in SampleMACrossover

              5. optimize for 11 nov to 11 nov....SA still gives you 3 nov chart and results

              6. optimize for 29oct to 29oct ....SA still gives you 29oct AND 3 nov chart and combined results

              7. optimize for 11 nov to 11 nov....SA still gives you 3 nov chart and results only

              8. disconnect MR

              9. optimize for 11 nov to 11 nov....SA still gives you 3 nov chart and results only

              10. optimize for 10 nov to 10nov....SA still gives you 10 nov chart and results

              11. optimize for 11 nov to 11 nov....SA now works properly

              12. optimize for 3 nov to 7 nov....SA works properly

              bottom line....MR overrides SA if MR is on (when I switched workspaces I did not realize I had left MR on)
              Last edited by ATI user; 11-13-2008, 04:47 AM.

              Comment


                #8
                Originally posted by NinjaTrader_Ben View Post
                Hello,



                For post #5, this is because this strategy has if(Historical) return; in OnBarUpdate(). This strategy is not meant for backtesting or optimizing.
                by 'this strategy' I assume you mean SampleAtmStrategy....historical is not the problem

                to test my theory that AtmStrategyCreate code does not work in SA

                1. save SampleAtmStrategy as SampleAtmStrategymod....comment out

                // if (Historical)
                // return;

                add code to plot a dot...

                if ( Close[0] < Open[0] )
                DrawDot("cross"+CurrentBar, true, 0, Open[0]+2,Color.Red);

                optimize and chart plots dots....however does not make trades

                2. create a parameter called offset...

                private int offset = 0;

                [Description("parameter to test cs in strategy analyzer ")]
                [Category("Parameters")]
                public int Offset
                {
                get { return offset; }
                set { offset = value; }
                }

                3. amend code to use Offset parameter...

                if (orderId.Length == 0 && atmStrategyId.Length == 0
                && Close[0] > Open[0]+Offset )//test offset parameter in SA

                4. optimize Offset parameter 1:2:1

                5. SA does not make trades....because it does not process AtmStrategyCreate code

                ..............
                in the case of my strategy, I had to add code to place trades in SA

                such as ...

                private IOrder entryOrder = null;

                if ( StrategyAnalyzer == "on" ) { // Sets a trail stop of x ticks
                SetTrailStop(CalculationMode.Ticks, StrategyAnalyzerTrail );
                }

                if ( StrategyAnalyzer == "on" && entryOrder == null )
                entryOrder = EnterShort();


                protected override void OnOrderUpdate(IOrder order)
                {
                if ( StrategyAnalyzer == "on" && entryOrder != null && entryOrder.Token == order.Token)
                {
                if (order.OrderState == OrderState.Filled)
                entryOrder = null;
                }
                }

                with this code I am able to place trades to test my entry triggers etc....I would be much happier if I could just use the AtmStrategyCreate code and also trail stops from my code...SA is very limited in this way
                Last edited by ATI user; 11-13-2008, 05:37 AM.

                Comment


                  #9
                  ATI User,

                  That is correct. SampleAtmStrategy and its concepts are not meant for backtesting and as such are not usable in the Strategy Analyzer. Here is a snippet from the AtmStrategyCreate() help guide article: "This method is not back testable and will not execute on historical data".

                  If you could mail in your replay files that would be great. josh [dot] peng [at] ninjatrader [dot] com. Thanks.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks for reporting this issue. We will add it to the list of future considerations.
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Aviram Y, Today, 05:29 AM
                    0 responses
                    1 view
                    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