Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orange connection / failed strategy

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

    Orange connection / failed strategy

    Connection instability is really starting to piss me off.
    I can leave my FXCM account connection on for weeks and never have a problem yet I am always getting crapped out from my PFG connection.

    Tonight I experienced an orange connection. Not sure how long it lasts but the internet connection seemed to be fine as my FXCM account was still pulling data just fine and did not disconnect but not so for NT7/PFG!

    I was running a strategy and could not disconnect and then reconnect the connection. It was just frozen with no data. While it was frozen it entered a trade. I was then forced to kill NT and restart completely. So I reconnect and now the strategy won't place the stop order that follows in order to protect. I remove and readd the strategy and still it won't place the stop!

    Why does this crap keep happening?

    12/6/2010 1:21:42 AM Ignore order amendment: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 1:29:49 AM Entered internal PlaceOrder() method at 12/6/2010 1:29:49 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName='' FromEntrySignal=''
    12/6/2010 1:29:49 AM Ignore order amendment: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 1:30:54 AM Entered internal PlaceOrder() method at 12/6/2010 1:30:54 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName='' FromEntrySignal=''
    12/6/2010 1:30:54 AM Ignore order amendment: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 1:34:50 AM Entered internal PlaceOrder() method at 12/6/2010 1:34:50 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName='' FromEntrySignal=''
    12/6/2010 1:34:50 AM Ignore order amendment: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 1:41:52 AM Entered internal PlaceOrder() method at 12/6/2010 1:41:52 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName='' FromEntrySignal=''
    12/6/2010 1:41:52 AM Ignore order amendment: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 1:42:11 AM Entered internal PlaceOrder() method at 12/6/2010 1:42:11 AM: BarsInProgress=0 Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName='' FromEntrySignal=''
    12/6/2010 1:42:11 AM Ignore order amendment: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.3379 SignalName=Buy' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 1:55:03 AM Entered internal PlaceOrder() method at 12/6/2010 1:55:03 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName='' FromEntrySignal=''
    12/6/2010 2:01:45 AM Entered internal PlaceOrder() method at 12/6/2010 2:01:45 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName='' FromEntrySignal=''
    12/6/2010 2:01:45 AM Ignore order amendment: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName=Sell' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 2:03:05 AM Entered internal PlaceOrder() method at 12/6/2010 2:03:05 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName='' FromEntrySignal=''
    12/6/2010 2:03:05 AM Ignore order amendment: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName=Sell' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 2:07:12 AM Entered internal PlaceOrder() method at 12/6/2010 2:07:12 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName='' FromEntrySignal=''
    12/6/2010 2:07:12 AM Ignore order amendment: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName=Sell' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 2:10:46 AM Entered internal PlaceOrder() method at 12/6/2010 2:10:46 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName='' FromEntrySignal=''
    12/6/2010 2:10:46 AM Ignore order amendment: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName=Sell' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'
    12/6/2010 2:13:44 AM Entered internal PlaceOrder() method at 12/6/2010 2:13:44 AM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName='' FromEntrySignal=''
    12/6/2010 2:13:44 AM Ignore order amendment: Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1.3329 SignalName=Sell' FromEntrySignal='' Reason='Order already has this stop price/limit price/quantity'


    Code:
    protected override void Initialize()
            {
    
                CalculateOnBarClose = true;
    			ExitOnClose = false;
    			TraceOrders = true;
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
                // Condition set 1
                if (DefaultInput[0] < ChandelierSAR(6, 4).Chandelier[0]
    				&& Time[0].DayOfWeek != DayOfWeek.Friday)
                {
                    EnterLongStop(DefaultQuantity, ChandelierSAR(6, 4).Chandelier[0], "");
    				DrawDot("My dot" + CurrentBar, false, 0, ChandelierSAR(6, 4).Chandelier[0], Color.Blue);
                }
    
                // Condition set 2
                if (DefaultInput[0] > ChandelierSAR(6, 4).Chandelier[0])
                {
                    ExitLongStop(ChandelierSAR(6, 4).Chandelier[0], "", "");
    				DrawDot("My dot" + CurrentBar, false, 0, ChandelierSAR(6, 4).Chandelier[0], Color.Blue);
    }

    Last edited by RDPoS; 12-06-2010, 02:34 AM.

    #2
    Ah of course. Even though the entry stop order was initiated by the strategy. When the connection went to the irrecoverable orange state forcing a reload. (Order was filled when the connection was orange) NT isn't smart enough to remember that the strategy generated the order on restart. Thus you can't use the strategy at all now!

    Why don't I have these problems on FXCM? Just NT/PFG?

    Comment


      #3
      Hello RDPoS,

      Can you please tell me what options you have enabled at Control Center-->Tools-->Options-->Strategies-->NinjaScript-tab.


      In addition, please note that NinjaTrader does not dictate when a connection is lost. It operates like a radio receiver in that it receives a signal from your broker and then displays/reports these signals back to you the trader. When a connection is lost, it is the broker's API that determines this and reports this to NinjaTrader which in turn reports this back to the trader.

      The common problems that contribute to this are:

      - ISP issues
      - hardware firewall issues changing IP addresses frequently
      - Dynamic ISP address switching the address frequently intraday. Usually this happens once a week but you may want to check with your ISP. If they do change daily, a static IP address may work.
      - With Windows XP SP2, if you have more than 10 open TCPIP socket connections open (10 programs making connections through the internet) windows will randomly shut down some connections
      - Broker servers having problems
      - Software, such as (corporate) firewalls, spyware and anti-virus software, that could be interfering the connection
      JasonNinjaTrader Customer Service

      Comment


        #4
        * wait until flatbefore executing live
        * cancel exit orders when a strategy is disabled ( I think I should uncheck this)

        On connection loss
        - disconnect delay seconds 10
        - number of restart attempts 4
        - restarts within x minutes 5
        - handling - keep running

        Comment


          #5
          Unfortunately because you have 'Wait until flat before executing live' enabled, it did not submit the stop order.

          Wait until flat before executing live
          When starting a NinjaScript strategy that relies on historical data for calculating its current positions and order states, it will wait until the strategy position has reached or crossed a flat position before executing any live orders. All trading done before this condition will be virtual, simulated trades.

          You restarted the automated strategy, however it was in a position. So it is as expected that no stop order is submitted.

          If you enabled 'Immediately submit live working historical orders', it would have submitted the stop order.
          JasonNinjaTrader Customer Service

          Comment


            #6
            So you are saying that if I enabled 'Immediately submit live working historical orders' that only the most recent relevant order would have been submitted and not the past orders that are automatically shown when running in simulation mode?

            Comment


              #7
              That is correct. If you enable 'Immediately submit live working historical orders', it will submit orders to reflect the current overall state of your strategy only.

              Immediately submit live working historical orders
              When starting a NinjaScript strategy that relies on historical data for calculating its current position and orders states, it will immediately submit live any working orders that reflect the current strategy's overall order state. It is IMPORTANT to understand that the position of the strategy reported in the Strategies tab may not reflect the actual account-based position reported in the Accounts tab at the time the strategy is started. In this scenario, it is highly recommend that the account position be synced to the strategy position.
              JasonNinjaTrader Customer Service

              Comment


                #8
                Thank you sir for your time and patience.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by CortexZenUSA, Today, 12:46 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by usazencortex, Today, 12:43 AM
                0 responses
                5 views
                0 likes
                Last Post usazencortex  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                168 responses
                2,266 views
                0 likes
                Last Post sidlercom80  
                Started by Barry Milan, Yesterday, 10:35 PM
                3 responses
                13 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X