Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy terminates itself

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

    strategy terminates itself

    Hello,
    the strategy runs in sim mode. Sometimes I get the msg like this:

    19.11.2009 10:17 Connection AMP FX: Primary connection=Connected, Price feed=Connected
    19.11.2009 10:17 Connection Gain: Rate feed re-connected
    19.11.2009 10:17 Strategy Strategy 'Strategy_Nofff_1' submitted an order that generated the following error 'UnableToSubmitOrder'. Strategy has sent cancel requests, attempted to close the position and terminated itself.
    19.11.2009 10:17 Order Order '2dde3bd7ae3744719e9f433d3edb29ad' can't be submitted: connection is unavailable Affected Order: Buy 1 Market
    19.11.2009 10:17 Order Order='2dde3bd7ae3744719e9f433d3edb29ad/Sim101' Name='p2' New State=Rejected Instrument='$GBPUSD' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=UnableToSubmitOrder Native error='Order '2dde3bd7ae3744719e9f433d3edb29ad' can't be submitted: connection is unavailable'
    19.11.2009 10:17 Default EnterLong instrument 11 Ask=1,6705
    19.11.2009 10:17 Connection Gain: Rate feed connection lost
    19.11.2009 10:17 Connection AMP FX: Primary connection=ConnectionLost, Price feed=ConnectionLost
    The reason, as I see, is that the connection is break. Sometimes after that the strategy stops.
    Is there any method that would make the strategy not to terminate itself?

    #2
    Hi nofff,

    Thank you for your post.

    This strategy terminates itself due to the disconnection.

    Please see the following link for more information about error handling: http://www.ninjatrader-support2.com/...error+handling
    KyleNinjaTrader Customer Service

    Comment


      #3
      OK. Thanks.

      Comment


        #4
        I'm getting a similar error, but it doesn't appear due to a lost connection:

        8/18/2015 4:50:17 AM|0|32|FXCM Demo, Failed to create order request affected Order: SellShort 12000 Market

        8/18/2015 4:50:17 AM|1|32|Order='6ea435a98013462aa03f87897a97f9e8/00937983' Name='S_FalseTrue_45000' New state=Rejected Instrument='$ZARJPY' Action=SellShort Limit price=0 Stop price=0 Quantity=12,000 Type=Market Filled=0 Fill price=0 Error=UnableToSubmitOrder Native error='Failed to create order request'

        8/18/2015 4:50:17 AM|1|128|Disabling NinjaScript strategy 'mpStrategy/1af9e1ce34c94262b9816aac72f043e8'


        The connection is active, so I'm not sure why it would fail to create an order. I'll also contact FXCM as this could be an issue on their side.

        In the meantime, does this look familiar, and what's the best way to catch this error in my strategy code. Thanks!

        Comment


          #5
          Just a quick follow-up: I talked to and did an online chat with FXCM. They said to contact you with this error. I'd definitely like to understand why an order can be rejected before I go live. There weren't any other orders open at the time, and no other circumstances that I can point to that would cause it.

          Thanks in advance for your help, and please let me know if you need anymore information.

          Comment


            #6
            Hello micprice,

            Are you able to make manual trades from NinjaTrader to FXCM?

            Does your strategy experience the same issue on the Sim101?

            Was there any movement in the market when the strategy was trying to place that order?
            (Any incoming ticks to drive the order events?)
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi Chelsea,

              I'm able to make manual trades in FXCM, and don't get this same behavior with Sim101. This only seem to be happening with my short term timeframes (2 min and 3 min), and not with my 60 min timeframe. All strategies are the same -- I'm just running three different timeframes using three different FXCM account.

              I'm not sure about the last situation (incoming ticks to drive the order). I thought at first it was the pair ($ZARJPY), which is lightly traded. However, it happened earlier this morning with $EURNZD which isn't as lightly traded.

              If I can provide anymore information, please let me know. I also sent platformsupport my log and config files.

              Comment


                #8
                I tried the following, and it seemed to fix my issue:

                Shutdown NinjaTrader and Go to the Start Menu
                Select My Documents--> NinjaTrader 7--> DB--> NinjaTrader.SDF.
                Right click on NinjaTrader.SDF and select "Rename." *Name it "OLDNinjaTrader.SDF."
                Then restart the software and NinjaTrader will create a fresh database file to use

                If I get the issue again, I'll update the thread. Thanks!!

                Comment


                  #9
                  Hi micprice,

                  I see that you are working with Patrick who will continue assisting with this issue.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    I am having the exact same issue.
                    I have deleted the DB folder inside Documents/Ninjatrader/..
                    Tried 2 different internet connections on 2 different PC computers.
                    Right now, I am only testing in the Control Center, and not even using my strategy itself in order to send Market Orders through Ninjatrader 7 to FXCM.

                    The currency pairs that is working:
                    EURUSD, AUDUSD and NZDUSD

                    NOT working:
                    USDJPY, GBPUSD, USDCHF, USD,CAD

                    Comment


                      #11
                      What's the error message?

                      Comment


                        #12
                        GBPUSD:
                        10/5/2016 1:01:01 PM Order Submitting order without strategy...
                        10/5/2016 1:01:01 PM Order 4. Ninjatrader FXCM, Failed to create order request affected Order: Buy 1000 Market
                        10/5/2016 1:01:01 PM Order Order='88518d0f97534e2bae66f75a68e312c2/2705086330' Name='' New state=Rejected Instrument='$GBPUSD' Action=Buy Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=UnableToSubmitOrder Native error='Failed to create order request'

                        USDJPY:
                        10/5/2016 1:00:05 PM Order Submitting order without strategy...
                        10/5/2016 1:00:05 PM Order 4. Ninjatrader FXCM, Failed to create order request affected Order: Sell 1000 Market
                        10/5/2016 1:00:05 PM Order Order='b05c854b7d0c4e68ad45e9af8fca3923/2705086330' Name='' New state=Rejected Instrument='$USDJPY' Action=Sell Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=UnableToSubmitOrder Native error='Failed to create order request'

                        USDCAD:
                        10/5/2016 11:37:54 AM Order Submitting order without strategy...
                        10/5/2016 11:37:48 AM Order 4. Ninjatrader FXCM, Failed to create order request affected Order: Buy 1000 Market
                        10/5/2016 11:37:48 AM Order Order='de0d387e69024e24a387e0af7f4ea750/2705086330' Name='' New state=Rejected Instrument='$USDCAD' Action=Buy Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=UnableToSubmitOrder Native error='Failed to create order request'

                        USDCHF:
                        10/5/2016 11:25:36 AM Order Submitting order without strategy...
                        10/5/2016 11:25:30 AM Order 4. Ninjatrader FXCM, Failed to create order request affected Order: Buy 1000 Market
                        10/5/2016 11:25:30 AM Order Order='93ee2c32274047b0b3bec55e65aa43c3/2705086330' Name='' New state=Rejected Instrument='$USDCHF' Action=Buy Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=UnableToSubmitOrder Native error='Failed to create order request'

                        BUT..


                        EURUSD works:
                        10/5/2016 11:36:58 AM Position Instrument='$EURUSD' Account='2705086330' Avg price=1.12097333333333 Quantity=3,000 Market position=Long Operation=Update Currency=UsDollar
                        10/5/2016 11:36:58 AM Execution Execution='87798008
                        10/5/2016 11:36:58 AM Order Order='87798008/2705086330' Name='' New state=Filled Instrument='$EURUSD' Action=Buy Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=1000 Fill price=1.12106 Error=NoError Native error=''
                        10/5/2016 11:36:57 AM Order Submitting order without strategy...
                        10/5/2016 11:36:57 AM Order Order='d39701cd9a3c452ba2f427d85038a978/2705086330' Name='' New state=PendingSubmit Instrument='$EURUSD' Action=Buy Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
                        Last edited by warcious; 10-04-2016, 10:21 PM.

                        Comment


                          #13
                          I've received your files and responded to you via email. Lets continue to work together via email.

                          Comment


                            #14
                            Hello,

                            My strategy is still terminating itself.
                            What happens is that one strategy that is running is impacting the other running strategy.
                            If I enter a trade in both strategies, then the 2:nd entry on the 2:nd strategy tries to cancel out my orders on my 1:st strategy and this is what I find in the trace and log files:
                            I see this:

                            2016-11-02 21:33:59:201 Strategy.StrategyBase.CancelAllOrders: Order='67fa8dd51c584395af82d1a4a80d6d21/Sim101' Name='Exit Long 50%' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.9032 Token='67fa8dd51c584395af82d1a4a80d6d21' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:203 Strategy.StrategyBase.CancelAllOrders: Order='dfbd8f8b796b4654a6099a3e11d2f417/Sim101' Name='Exit Long STOP' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.903 Token='dfbd8f8b796b4654a6099a3e11d2f417' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='67fa8dd51c584395af82d1a4a80d6d21/Sim101' Name='Exit Long 50%' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.9032 Token='67fa8dd51c584395af82d1a4a80d6d21' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='dfbd8f8b796b4654a6099a3e11d2f417/Sim101' Name='Exit Long STOP' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.903 Token='dfbd8f8b796b4654a6099a3e11d2f417' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='67fa8dd51c584395af82d1a4a80d6d21/Sim101' Name='Exit Long 50%' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.9032 Token='67fa8dd51c584395af82d1a4a80d6d21' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='dfbd8f8b796b4654a6099a3e11d2f417/Sim101' Name='Exit Long STOP' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.903 Token='dfbd8f8b796b4654a6099a3e11d2f417' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='67fa8dd51c584395af82d1a4a80d6d21/Sim101' Name='Exit Long 50%' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.9032 Token='67fa8dd51c584395af82d1a4a80d6d21' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='dfbd8f8b796b4654a6099a3e11d2f417/Sim101' Name='Exit Long STOP' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.903 Token='dfbd8f8b796b4654a6099a3e11d2f417' Gtd='12/1/2099 12:00:00 AM'
                            2016-11-02 21:33:59:204 Strategy.StrategyBase.CancelAllOrders: Order='67fa8dd51c584395af82d1a4a80d6d21/Sim101' Name='Exit Long 50%' State=Filled Instrument='$EURGBP' Action=Sell Limit price=0 Stop price=0 Quantity=0.01M Strategy='ChartSlopeTrader' Type=Market Tif=Gtc Oco='' Filled=10000 Fill price=0.9032 Token='67fa8dd51c584395af82d1a4a80d6d21' Gtd='12/1/2099 12:00:00 AM'

                            etc....

                            There is no other error appearing, when this strange behavior occurs.

                            I really do not know what is causing this error that stops me from trading using my strategy. Can you help me on how to debug this further?


                            I am attaching the trace file where I reproduced this error from scratch.
                            Attached Files
                            Last edited by warcious; 11-02-2016, 05:00 AM.

                            Comment


                              #15
                              Could this odd strategy disabling behavior have something to do with how I add additional currency-pairs through Initialize() in order to calculate the correct lot-size?

                              LoadAllCurrencyPairs(int minute_chart) is being triggered from Initialize() as:
                              this.LoadAllCurrencyPairs(1);

                              private void LoadAllCurrencyPairs(int minute_chart)
                              {
                              foreach (string pair in this._forextList)
                              {

                              this.Add("$" + pair, PeriodType.Minute, minute_chart);
                              }
                              }
                              Last edited by warcious; 11-02-2016, 05:08 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by usazencort, Today, 01:16 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post usazencort  
                              Started by kaywai, 09-01-2023, 08:44 PM
                              5 responses
                              603 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by xiinteractive, 04-09-2024, 08:08 AM
                              6 responses
                              22 views
                              0 likes
                              Last Post xiinteractive  
                              Started by Pattontje, Yesterday, 02:10 PM
                              2 responses
                              21 views
                              0 likes
                              Last Post Pattontje  
                              Started by flybuzz, 04-21-2024, 04:07 PM
                              17 responses
                              230 views
                              0 likes
                              Last Post TradingLoss  
                              Working...
                              X