Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SMA Backtesting

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

    SMA Backtesting

    Hello,

    I want to use a simple moving average crossover. (5,20). And it doesn't seem to enter on the crossover correctly...

    Thanks in advance


    Hobs

    mycustomstrategy.doc

    #2
    Hello PilotHobs,

    What is the incorrect behavior you are experiencing?

    Is the order not entering at all?

    Is the order appearing on the next bar after the cross?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by PilotHobs View Post
      Hello,

      I want to use a simple moving average crossover. (5,20). And it doesn't seem to enter on the crossover correctly...

      Thanks in advance


      Hobs

      [ATTACH]31415[/ATTACH]
      Just to say very briefly that you have 'CrossAbove' for both long and short. One of these should be 'CrossBelow'.

      Comment


        #4



        This is an example of not entering the trade at the crossover.

        Thanks


        Hobs
        Attached Files
        Last edited by PilotHobs; 02-20-2015, 05:07 PM.

        Comment


          #5
          I think that was the problem. I fixed it and am getting a much better graph.



          Thanks



          Hobs

          Comment


            #6
            Originally posted by PilotHobs View Post
            I think that was the problem. I fixed it and am getting a much better graph.

            Thanks

            Hobs
            Hobs - nice to hear it's now working out.

            I'm guessing that the error occurred because you copied the first condition for the second condition, intending to change everything as necessary but forgot to do this.

            I've done this and continue to do this so often. I wasted a whole day recently because I copied a line of C# 'algebra' and didn't alter the letters accordingly.

            It's a shame the Ninja scripts can't be formatted so areas that need changing can be highlighted.

            If only...

            Cheers,

            Ed

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            78 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            40 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            63 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            63 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            54 views
            0 likes
            Last Post CarlTrading  
            Working...
            X