Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss Not working

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

    SetStopLoss Not working

    Hi, I have attached the screenshots below.
    - for the second screenshot, it's showed that my stop loss happened after a 3 point drop while within my code I have stated that the stop loss would be 2 points. I was wondering would there be any way that I could fix it, or is it a problem due to the strategy analyzer.
    - For all the trades that the Strategy has entered, I have noticed that all of them exit or stop loss on the next bar. Once again I was wondering would it be because of the simulated environment due to the strategy analyzer or is there another way that I could fix it.
    - My last question is will there be any way I could access the data from the EMA and the SMA. For example, I would want to enter long if the SMA is below my bars and I want the slope of the SMA to be in an incline. Would there be any case that I could access the EMA at each individual bar like you would be able to access a bars close data with Close[0].

    #2
    Hi horace chow,
    The photo seems to suggest that entry during a candle is fine.
    Does exit behaviour change, if you
    - use Calculate.OnPriceChange,
    - use Tick replay,
    - change data series to single tick?
    I'd try one by one, in this order.
    NT-Roland

    Comment


      #3
      Hi, thanks for your question.

      Adding intrabar granularity can improve the fill estimation that is done by the strategy analyzer. Please review this post from our colleague Chelsea that already details this concept:

      https://ninjatrader.com/support/foru...ive#post773377

      Yes its possible to use many indicators in a strategy. We have an example in the platform called "SampleMACrossover" That is a good example of where to start with accessing indicator variables.

      Please let me know if I can assist any further.

      Comment


        #4
        I have tried using Calculate.OnPriceChange, Tick replay, and change data series to single tick, However, it's the same results, some follow the code and exist with stop loss of 2 points but some still exist after 3 points or more.

        Comment


          #5
          Hi horace, thanks for your reply.

          Did you add a smaller time frame to fill your orders on? That can be found in the strategy analyzer settings under "Historical Fill processing". Try adding a 1 Tick series. If you have a reduced test script that I can test I would be happy to do that as well.

          I look forward to hearing from you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          110 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          59 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          37 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          41 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          78 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X