• 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

Problems placing order

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

    Problems placing order

    I am using Ninja trader to trade through the brokerage Mb Trading. My program is occasionally entering trades that are being rejected, and not entering many more than should have occurred according to back tested results. My connections are fine and I'm pretty sure about my default order quantity. I am running the strategy off the chart and in the control center the strategy appears green and running. I will post my main segment of code below, can anyone think of any problems that may be causing this or identify any problems in my main segment of code, more specifically especially with order entry or something?

    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Indicator;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Strategy;
    #endregion

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    /// <summary>
    /// Enter the description of your strategy here
    /// </summary>
    [Description("Enter the description of your strategy here")]
    public class USDJPY : Strategy
    {
    #region Variables
    // Wizard generated variables
    private int momperiod =5;
    private int momemaperiod = 2;
    private double momlimit = .04;
    private int tperiod = 9;
    private double tlimit = .003;
    private int mom2period = 4;
    private double mom2limit= 4;
    private int mom2emaperiod = 1;
    private int dperiod = 3;
    private double smoroclimit = .1;
    private int smorocema = 1;
    private int smorocperiod = 1;
    private double stoploss = .005;
    // User defined variables (add any user defined variables below)
    #endregion

    /// <summary>
    /// This method is used to configure the strategy and is called once before any strategy method is called.
    /// </summary>
    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    Add(PeriodType.Minute, 90);
    Add(PeriodType.Minute, 90);
    Add(PeriodType.Day, 1);
    SetStopLoss("", CalculationMode.Percent, Stoploss, false);
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {

    double dval1 = SweetIndicator(BarsArray[2], dperiod)[0];
    double dval2 = SweetIndicator(BarsArray[2], dperiod)[1];
    if (BarsInProgress != 0)
    return;
    if (SmoothedExpMomentumJPY(momemaperiod, momperiod)[0] > momlimit && (TRIXSlope(BarsArray[1], tperiod)[0] > tlimit && MomentumSquaredJPY(BarsArray[3], mom2emaperiod, mom2period)[0] > mom2limit && dval1 >= dval2 && SmoothROCJPY(BarsArray[3], smorocema, smorocperiod)[0] > smoroclimit )){
    EnterLong(DefaultQuantity);
    }
    else if (SmoothedExpMomentumJPY(momemaperiod, momperiod)[0] < - momlimit && (TRIXSlope(BarsArray[1],tperiod)[0] < - tlimit)&& MomentumSquaredJPY(BarsArray[3], mom2emaperiod, mom2period)[0] > mom2limit && dval2 >= dval1 && SmoothROCJPY(BarsArray[3], smorocema, smorocperiod)[0] > smoroclimit){
    EnterShort(DefaultQuantity);
    }
    else{
    ExitLong();
    ExitShort();
    }
    }

    #region Properties
    [Description("")]
    [Category("Parameters")]
    public int Momperiod
    {
    get { return momperiod; }
    set { momperiod = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Momemaperiod
    {
    get { return momemaperiod; }
    set { momemaperiod = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public double Momlimit
    {
    get { return momlimit; }
    set { momlimit = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public double Tlimit
    {
    get { return tlimit; }
    set { tlimit = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Tperiod
    {
    get { return tperiod; }
    set { tperiod = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Dperiod
    {
    get { return dperiod; }
    set { dperiod = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Mom2period
    {
    get { return mom2period; }
    set { mom2period = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Mom2emaperiod
    {
    get { return mom2emaperiod; }
    set { mom2emaperiod = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public double Mom2limit
    {
    get { return mom2limit; }
    set { mom2limit = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Smorocperiod
    {
    get { return smorocperiod; }
    set { smorocperiod = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public int Smorocema
    {
    get { return smorocema; }
    set { smorocema = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public double Smoroclimit
    {
    get { return smoroclimit; }
    set { smoroclimit = Math.Max(0, value); }
    }
    [Description("")]
    [Category("Parameters")]
    public double Stoploss
    {
    get { return stoploss; }
    set { stoploss = Math.Max(0, value); }
    }

    #endregion
    }
    }

    #2
    JamesF, I suggest you work with TraceOrders to debug the order results you get - http://www.ninjatrader-support.com/H...aceOrders.html

    Please see also this tip here - http://www.ninjatrader-support2.com/...ead.php?t=3627
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Here is a segment from the output window. What do you think the problem is?

      5/15/2009 12:34:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:34:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:35:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:35:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:35:00 AM Ignored PlaceOrder() method at 5/15/2009 12:35:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:36:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:36:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:36:00 AM Ignored PlaceOrder() method at 5/15/2009 12:36:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:37:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:37:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:37:00 AM Ignored PlaceOrder() method at 5/15/2009 12:37:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:38:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:38:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:38:00 AM Ignored PlaceOrder() method at 5/15/2009 12:38:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:39:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:39:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:39:00 AM Ignored PlaceOrder() method at 5/15/2009 12:39:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:40:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:40:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:40:00 AM Ignored PlaceOrder() method at 5/15/2009 12:40:00 AM: Action=Buy OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Buy' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:41:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:41:00 AM: Action=SellShort OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:42:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:42:00 AM: Action=SellShort OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:42:00 AM Ignored PlaceOrder() method at 5/15/2009 12:42:00 AM: Action=SellShort OrderType=Market Quantity=0.03M LimitPrice=0 StopPrice=0 SignalName='Sell short' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      5/15/2009 12:43:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:43:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:43:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:43:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:43:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:43:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00003/Back101' Name='Stop loss' State=Working Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=9679.84 Quantity=0.03M Strategy='Test' Type=Stop Tif=Gtc Oco='NT-00002' Filled=0 Fill price=0 Token='905f10d237554cc5a270c74a010d9b0a' Gtd='12/1/2099 12:00:00 AM'
      5/15/2009 12:44:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:44:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:44:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:44:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:44:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:44:00 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:45:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:45:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:45:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:45:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:45:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:45:00 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:46:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:46:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:46:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:46:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:46:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:46:00 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:47:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:47:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:47:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:47:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:47:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:47:00 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:48:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:48:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:48:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:48:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:48:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:48:00 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:49:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:49:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:49:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'

      5/15/2009 12:49:00 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:50:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:50:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
      5/15/2009 12:50:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      5/15/2009 12:50:00 AM Entered internal PlaceOrder() method at 5/15/2009 12:50:00 AM: Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''

      Comment


        #4
        Hi, some entry order are getting ignored because of your current EntryHandling settings - http://www.ninjatrader-support.com/H...yHandling.html

        Further to your code, I'm not sure why are you are adding two times the 90 min bars object.

        Best would be run this with TraceOrder until you're getting a rejected order as you wrote in your first post, then check for the reason in the outputs.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi, JamesF

          Did you manage to resolve this problem?

          I had something similar happen today with NT connected to MB Trading. I'm sure there is a simple answer, and I have only just started looked into it, but it would be helpful to learn what you discovered.

          Many thanks for any assistance.

          Ben

          Comment


            #6
            Ben, which exact issue did you see today in connection with MBT?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hi, Bertrand

              Thanks for your note.

              I am already getting some help from NinjaTrader_Ryan (and MB Trading) for this...

              Here below is the dialogue so far (and I'll post the resolution when I get there!).

              ==== my note to support ====

              Dear Support

              I had an order rejected this morning and I don't understand the reason.

              Can you help me with this?

              Trace file attached.

              Thanks
              Ben


              ==== Support's response ====
              Hello Ben,

              Thank you for your note.

              So you entered the market:

              2009-11-19 09:30:38:109 (MBTrading) Cbi.OrderStatusEventArgs.Process: Order='1dj3t01:02ga/********' Name='Buy' New State=Filled Instrument='...' Action=Buy Limit price=0 Stop price=0 Quantity=... Type=Market Filled=... Fill price=..,.. Error=NoError Native error=''

              The next accepted order was the stop loss:

              2009-11-19 09:30:38:390 (MBTrading) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='1dj3t01:02h2/*******' Name='Stop loss' New State=Accepted Instrument='...' Action=Sell Limit price=0 Stop price=..,.. Quantity=... Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''

              But then the profit target was rejected:

              2009-11-19 09:30:38:406 (MBTrading) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='1dj3t01:02h3/*******' Name='Profit target' New State=Rejected Instrument='...' Action=Sell Limit price=...,... Stop price=0 Quantity=... Type=Limit Filled=0 Fill price=0 Error=OrderRejected Native error=' Order rejected for reason: Pending live orders'

              Which had the effect of cancelling your stop loss order since the orders were OCO:

              2009-11-19 09:30:40:296 (MBTrading) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='1dj3t01:02h2/*******' Name='Stop loss' New State=Cancelled Instrument='...' Action=Sell Limit price=0 Stop price=..,.. Quantity=... Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''

              However, even though I see the process, I can not say why the profit target order was rejected, but based on the error it would seem that your entry order had not been fully filled. You will want to contact MB Trading for clarification on why it that order was specifically cancelled by the broker.

              Sincerely,
              Ryan

              ========

              MB Trading are now investigating ....

              Comment


                #8
                Ok, sounds good, please let us know what develops...this is on latest NT 6.5.1000.14 and MBT Navigator 11.3.0.4, correct?
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  ...this is on latest NT 6.5.1000.14 and MBT Navigator 11.3.0.4, correct?
                  Yes, both versions are as you state

                  Comment


                    #10
                    Ok, great - then please let us know why the target was rejected, as this is listed as a native error.... thanks
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Hi,
                      I have had a quick and full response from the MB Trading support people
                      (their support folks are great, just like NT’s...).

                      In a nutshell, I am told MBT Navigator doesn’t support a bracketed set of entry/profit target/stop loss OCO orders. Two orders can be bracketed together, but not three.


                      Here’s the sequence of what happened, and then MB Trading’s response:
                      = = = = = = = = = = = = = = = = =


                      I entered the market.
                      *** MBT Navigator “order book” *********
                      09:30:35 Execute Bought N of X @ Market
                      === NT log =========
                      2009-11-19 09:30:38:109 (MBTrading) Cbi.OrderStatusEventArgs.Process: Order='1dj3t01:02ga/********' Name='Buy' New State=Filled Instrument='...' Action=Buy Limit price=0 Stop price=0 Quantity=... Type=Market Filled=... Fill price=..,.. Error=NoError Native error=''


                      The next accepted order was the stop loss:
                      === NT log =========
                      2009-11-19 09:30:38:390 (MBTrading) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='1dj3t01:02h2/*******' Name='Stop loss' New State=Accepted Instrument='...' Action=Sell Limit price=0 Stop price=..,.. Quantity=... Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''


                      The profit target order was submitted by NT at exactly the same time. As MBT Navigator apparently won’t accept two orders bracketed together which arrive at the same time, MBT Navigator rejected the profit target order …
                      *** MBT Navigator “order book” *********
                      09:30:38 Rejected Sell N of X @ ..,.. Limit
                      === NT log =========
                      2009-11-19 09:30:38:406 (MBTrading) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='1dj3t01:02h3/*******' Name='Profit target' New State=Rejected Instrument='...' Action=Sell Limit price=...,... Stop price=0 Quantity=... Type=Limit Filled=0 Fill price=0 Error=OrderRejected Native error=' Order rejected for reason: Pending live orders'


                      As MBT Navigator rejected the profit target order, NT cancelled the stop loss order (since the orders were OCO):
                      === NT log =========
                      2009-11-19 09:30:40:296 (MBTrading) Cbi.Connection.ProcessEventArgs.OrderStatusEventAr gs: Order='1dj3t01:02h2/*******' Name='Stop loss' New State=Cancelled Instrument='...' Action=Sell Limit price=0 Stop price=..,.. Quantity=... Type=Stop Filled=0 Fill price=0 Error=NoError Native error=''
                      *** MBT Navigator “order book” *********
                      09:30:38 Cancelled Sell N of X Stop ..,.. Market



                      Fortunately, the sequence of events also resulted in the open position being closed ... I realise that I don't yet understand why that happened, so I'll have to chase that up tomorrow ... any idea?



                      Here is MB Trading’s response:
                      *********
                      Thank you for your detailed e-mail. After reviewing the sequence of events I do see an issue with the way you are sending us orders. The closest order type to meet your strategy that we offer is a TTO ( threshold trigger order ) where you may bracket your position with a stop loss and take target profit, and yes one would cancel the other which ever trigger is reached first would subsequently cancel your other trigger price. Unfortunately per your desired strategy we do not currently support this type of order that works with bracketing a limit with a stop. This explains your order in X to sell N shares with a stop at ..,.. & limit @..,.. .

                      To view a full list of order types available at our firm please go here --> https://www.mbtrading.com/stocksOrderTypes.aspx

                      **********

                      Where does this leave me?

                      Before tomorrow’s session wherever I have my SetStopLoss(string fromEntrySignal, CalculationMode mode,double value,bool simulated) command, I will set simulated to “true”, so that only the profit target order is sent initially …

                      Does this seem sensible?

                      I am aware that simulated stops won’t function as required if my computer/internet connection/powerline fails, but I am not too agitated by this as – even though I am autotrading – I am always beside my trading computer during the core session and audio alerts (from NT, or from my UPS) will let me know if there is a problem, which I can deal with by calling the broker directly if needs be.

                      Comment


                        #12
                        Hi Ben, do you have a ticket number under which I could take a look at the full trace and logs you sent in? Setting the stop to simulated should prevent this rejection, but I'm not sure why you saw this happening, so reviewing the logs would be beneficial, thanks
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Thanks, Bertrand

                          {245299}

                          Ben

                          Comment


                            #14
                            Thanks Ben, saw the trace, if you have it still please forward me the log from the 19th as well to support at ninjatrader dot com Attn Bertrand, thanks
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Done

                              Thanks, Bertrand

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by spikeruk, Today, 01:49 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_PaulH  
                              Started by Yandychang, Today, 02:16 PM
                              3 responses
                              11 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by priceisking, Today, 01:16 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_PaulH  
                              Started by kashyapjdave, 03-23-2017, 12:12 AM
                              11 responses
                              1,956 views
                              0 likes
                              Last Post forextrader2003  
                              Started by Gav_G, 07-26-2018, 04:29 PM
                              5 responses
                              422 views
                              0 likes
                              Last Post NinjaTrader_PaulH  
                              Working...
                              X