Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Not Working

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

    Stop Not Working

    I have created a simple strategy using the wizard that enters trades on a break of the EMA. I want to set a stop loss at the EMA[1]. Everything works fine, entries, profit target, Stop Loss EXCEPT for my EMA exit rule.

    I have tried all of the following with no success:

    - Assigned Variable1 = EMA[1] and made that my stop level
    - Assigned Variable1 = EMA[1] and made that my trailing stop level
    - Created a Condition testing if CurrentBid < EMA[1] (or Variable1), exit long
    - Created a Condition testing if CurrentAsk > EMA[1] (or Variable1), exit short
    - Named entries

    I'm sure there is an answer here as this is a pretty straight forward issue....thanks for the help!

    #2
    Hello jtfancher,

    Thank you for your post.

    Do you get any errors on the Log tab of the Control Center when backtest this strategy? If so, what do these errors report?

    As a test, does the strategy work if you change the EMA to EMA[0]?

    I look forward to assisting you further.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks Matthew. I do not get an error message and I have also tried EMA[0].

      ????

      Comment


        #4
        Hello,

        Thanks for checking.

        Is the exit rule the only statement which uses the CurrentBid/Ask? Do you know if you have bid/ask data for the interval you are back testing on? You can check your historical data by going to Tools--> Historical Data Manager

        Can you clarify who you connect to for data and which interval you are backtesting on?
        MatthewNinjaTrader Product Management

        Comment


          #5
          Matthew - I use Mirus. I think you may be onto something but I don't see "Last" as a choice for price data?

          Comment


            #6
            jtfancher,

            Mirus/Zen-Fire should give you the appropriate bid ask data. However, if you're not seeing the last price in your data manager, I would suggest opening a chart for the instrument you are trading and ensure you can download this data and view in a chart.

            Then run the backtest again and let me know if you have issues.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Matthew - let me clarify...."Last" is not a choice in Ninja Condition Builder. I do get Last on my data feed. thx

              Comment


                #8
                jtfancher,

                Thanks for the clarification.

                To use the Last price, please use PriceData--> Close
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  Matthew - That doesn't work...it executes a trade on the Close of the bar - which I believe is the definition of Close....

                  I did go back and download Bid and Ask data (which I assume updated my chart) but the trades still did not execute.

                  Comment


                    #10
                    jtfancher,

                    "it executes a trade on the Close of the bar - which I believe is the definition of Close...."

                    Correct - you only the closing value will be used in a historical backtest. You can not access the intrabar data through the strategy analyzer.

                    Can you clarify if you changed your condition to use the Close value that the works? Or do you see the same issue regardless if you use CurrentBid/Ask and Close?
                    MatthewNinjaTrader Product Management

                    Comment


                      #11
                      Matthew - I think the issue is execution on close only. My condition executes after the bar closes but trailing stops execute mid-bar. Seems like I should get other stops to do the same????

                      Comment


                        #12
                        jtfancher,

                        You will need to run this strategy in real-time to see if you experience the same behavior, or if you receive results that you expect.

                        I would also suggest reading our Help Guide article on Discrepancies: Real-Time vs Backtest for further clarification:

                        MatthewNinjaTrader Product Management

                        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