• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fixed stop loss

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

    Fixed stop loss

    Hello ,
    I have a fixed 6 tick stop. Still, he doesn't close the market after 6 ticks, why? (Backtest) I didn't have the problem with other strategies. Tried a lot of settings, but couldn't solve the problem Thanks!

    #2
    Hi Burak, thanks for your note.

    Is the stop never created or is it passed up by the price? Are there any errors in the Log tab of your Control Center about the strategy?

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello , I don't get an error message. The stop price is exceeded , it passed up by the price.

      Comment


        #4
        Hi Burak,

        If the Stop variable is set to 6, I would expect the order to be submitted.

        Please enable TraceOrders and re-run the backtest.
        https://ninjatrader.com/support/foru...121#post791121

        Then, please include the output from the output window with your reply.

        At what time is the entry placed that is not being exited by the stop loss?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello, here is the text / output (But unfortunately
          in German) :

          29.11.2019 18:40:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00107-2311' account='Backtest' name='Profit target' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.41 stopPrice=0 quantity=1 tif=Gtc oco='NT-00070-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 18:06:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 18:40:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00107-2311' account='Backtest' name='Profit target' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.41 stopPrice=0 quantity=1 tif=Gtc oco='NT-00070-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 18:06:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 18:49:00 Strategy 'MyFXdreamPserie/-1': Interne SubmitOrderManaged() Methode eingegeben bei 29.11.2019 18:49:00: BarsInProgress=0 Aktion=SellShort OrderTyp=Market Anzahl=1 LimitPreis=0 StopPreis=0 SignalName='' FromEntrySignal=''
          29.11.2019 19:00:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00119-2311' account='Backtest' name='Profit target' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.4 stopPrice=0 quantity=1 tif=Gtc oco='NT-00078-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 18:49:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:00:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00119-2311' account='Backtest' name='Profit target' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.4 stopPrice=0 quantity=1 tif=Gtc oco='NT-00078-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 18:49:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:03:00 Strategy 'MyFXdreamPserie/-1': Interne SubmitOrderManaged() Methode eingegeben bei 29.11.2019 19:03:00: BarsInProgress=0 Aktion=SellShort OrderTyp=Market Anzahl=1 LimitPreis=0 StopPreis=0 SignalName='' FromEntrySignal=''
          29.11.2019 19:18:00 Strategy 'MyFXdreamPserie/-1': Interne SubmitOrderManaged() Methode eingegeben bei 29.11.2019 19:18:00: BarsInProgress=0 Aktion=SellShort OrderTyp=Market Anzahl=1 LimitPreis=0 StopPreis=0 SignalName='' FromEntrySignal=''
          29.11.2019 19:20:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00121-2311' account='Backtest' name='Stop loss' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Stop Markt' limitPrice=0 stopPrice=55.8 quantity=1 tif=Gtc oco='NT-00080-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:03:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:20:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00121-2311' account='Backtest' name='Stop loss' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Stop Markt' limitPrice=0 stopPrice=55.8 quantity=1 tif=Gtc oco='NT-00080-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:03:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:28:00 Strategy 'MyFXdreamPserie/-1': Interne SubmitOrderManaged() Methode eingegeben bei 29.11.2019 19:28:00: BarsInProgress=0 Aktion=SellShort OrderTyp=Market Anzahl=1 LimitPreis=0 StopPreis=0 SignalName='' FromEntrySignal=''
          29.11.2019 19:29:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00128-2311' account='Backtest' name='Profit target' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=54.94 stopPrice=0 quantity=1 tif=Gtc oco='NT-00083-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:28:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:29:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00128-2311' account='Backtest' name='Profit target' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=54.94 stopPrice=0 quantity=1 tif=Gtc oco='NT-00083-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:28:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:32:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00125-2311' account='Backtest' name='Profit target' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.19 stopPrice=0 quantity=1 tif=Gtc oco='NT-00081-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:18:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:32:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00125-2311' account='Backtest' name='Profit target' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.19 stopPrice=0 quantity=1 tif=Gtc oco='NT-00081-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:18:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:39:00 Strategy 'MyFXdreamPserie/-1': Interne SubmitOrderManaged() Methode eingegeben bei 29.11.2019 19:39:00: BarsInProgress=0 Aktion=SellShort OrderTyp=Market Anzahl=1 LimitPreis=0 StopPreis=0 SignalName='' FromEntrySignal=''
          29.11.2019 19:41:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00131-2311' account='Backtest' name='Profit target' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.28 stopPrice=0 quantity=1 tif=Gtc oco='NT-00086-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:39:00' gtd='2099-12-01' statementDate='2020-02-18'
          29.11.2019 19:41:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00131-2311' account='Backtest' name='Profit target' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.28 stopPrice=0 quantity=1 tif=Gtc oco='NT-00086-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:39:00' gtd='2099-12-01' statementDate='2020-02-18'

          Comment


            #6
            Hi Burak,

            As a tip, you can save the output from the output window to a text file by right-clicking the NinjaScript Output window > select Save As > give the file a name > click Save.
            Then you can attach the text file with your post.

            Below is a link to a forum post that demonstrates using prints to understand behavior that discusses this.
            https://ninjatrader.com/support/foru...121#post791121

            I am only seeing one stop loss that was placed but then was cancelled.

            29.11.2019 19:20:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00121-2311' account='Backtest' name='Stop loss' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Stop Markt' limitPrice=0 stopPrice=55.8 quantity=1 tif=Gtc oco='NT-00080-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 19:03:00' gtd='2099-12-01' statementDate='2020-02-18'

            29.11.2019 19:20:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00121-2311' account='Backtest' name='Stop loss' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Stop Markt' limitPrice=0 stopPrice=55.8 quantity=1


            The text provided starts with a profit target that is cancelled but there is no stop loss.

            29.11.2019 18:40:00 Strategie 'MyFXdreamPserie/-1': Ausstehender Austiegsauftrag gelöscht, da die zugeordnete Position geschlossen wurde, orderId='NT-00107-2311' account='Backtest' name='Profit target' orderState=Working instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.41 stopPrice=0 quantity=1 tif=Gtc oco='NT-00070-2311' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-29 18:06:00' gtd='2099-12-01' statementDate='2020-02-18'

            29.11.2019 18:40:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00107-2311' account='Backtest' name='Profit target' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Limit' limitPrice=55.41 stopPrice=0 quantity=1

            This profit target should not be possible as there is no entry order being submitted before it..

            Are you seeing the first filled order is a profit target and not an entry order?

            Is 18:40 when the price traveled through the stop?

            If so, it looks like the issue was that there was no entry entry submitted, but somehow a profit target was submitted, but a stop loss was never submitted.

            If this is correct, I would like to test the script on my end to find why profit target was submitted without an entry and why no stop loss was submitted.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello, thanks for your reply.

              Here again the (full) output as a file:
              And also the strategy
              Attached Files

              Comment


                #8
                Hello Burak,

                The first stop loss cancelled is at 17:30 on November 27th.

                27.11.2019 17:30:00 Strategie 'MyFXdreamPserie/-1': OCO gepaarter Auftrag gelöscht: BarsInProgress=0, orderId='NT-00010-76' account='Backtest' name='Stop loss' orderState=Cancelled instrument='CL 04-20' orderAction=BuyToCover orderType='Stop Markt' limitPrice=0 stopPrice=58.27 quantity=1 tif=Gtc oco='NT-00006-76' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-11-27 17:05:00' gtd='2099-12-01' statementDate='2020-02-18'

                Is your inquiry about why this order was cancelled?

                I am not able to import the file you have provided.
                Is this exported from Tools > Export > NinjaScript Addon?
                https://ninjatrader.com/support/help...tAsSourceFiles
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hello ,

                  I exported the file again as you explained above.

                  The stop in back testing (TickReplay) is greater than selected. In the same way, the profits were not right.
                  I use a fixed stop and profit target

                  Attached Files

                  Comment


                    #10
                    Hello Burak,

                    When you mention:

                    "The stop in back testing (TickReplay) is greater than selected.", are you asking about why a stop loss filled at a specific price?

                    Which order is the order in question?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello ,

                      I uploaded a picture again so that they can understand the problem better.
                      You can see that the stop of 9 points is not met.
                      The profit target is also greater than 30 points.
                      Attached Files

                      Comment


                        #12
                        Hello Burak,

                        Ok, you would like to know why a stop order has filled at a specific price.

                        It may be that the next value price to fill the order is further past the stop price of the order.

                        What is the submission price of this order?
                        What is the open, high, low, and close of the fill bar?

                        Are the orders submitted to a 1 tick added series for intra-bar granularity for order fill accuracy?
                        https://ninjatrader.com/support/foru...377#post773377
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Hello ,

                          I added the additional 1 tick series because of the BlockVolume indicator.

                          If I run the backtest without TickReplay, the results are suddenly correct again.
                          Shouldn't it be more accurate/exact with TickRepaly?

                          Best Regards

                          Comment


                            #14
                            Hello Burak,

                            From the help guide:
                            "Tick Replay is not intended to function in NinjaScript strategy backtests, and will not provide the same results as running a strategy on live data with Tick Replay enabled. For greater order-fill resolution in strategy backtests, you can use the High Fill Resolution in the Strategy Analyzer."
                            https://ninjatrader.com/support/help...ick_replay.htm

                            I've also mentioned this in the forum post I have linked you about intra-bar granularity.

                            No, it should not be more accurate with only TickReplay.
                            Chelsea B.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by qewcool, Yesterday, 10:51 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post qewcool
                            by qewcool
                             
                            Started by momchi, Yesterday, 10:09 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post momchi
                            by momchi
                             
                            Started by crokusek, Yesterday, 09:56 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post crokusek  
                            Started by crokusek, Yesterday, 09:43 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post crokusek  
                            Started by Gregory Arkadin, Yesterday, 03:31 PM
                            0 responses
                            14 views
                            0 likes
                            Last Post Gregory Arkadin  
                            Working...
                            X