Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error when taking long position with bid price by ATM

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

    Error when taking long position with bid price by ATM

    Hi,

    I am getting the following error when try to take long position by ATM.

    Playback101, Buy stop or buy stop limit orders can't be placed below the market. affected Order: BuyToCover 1 StopMarket @ 80

    Code:
    void TakePosition()
    {

    Action<ErrorCode,string> callback = (atmCallbackErrorCode, atmCallBackId) => {
    if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
    isAtmStrategyCreated = true;
    };

    switch (GetBarStatus(CurrentBar))
    {
    case BarStatus.Falling:
    AtmStrategyCreate(OrderAction.Sell, OrderType.Limit, GetCurrentAsk(), 0, TimeInForce.Day, orderId, ATMName, atmStrategyId, callback);

    break;
    case BarStatus.Rising:
    AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, GetCurrentBid(), 0, TimeInForce.Day, orderId, ATMName, atmStrategyId, callback);

    break;
    default:
    break;
    }

    }

    #2
    The ATM strategy template specified by the string variable ATMName, what does it look like?

    Can you post a screenshot of that ATM strategy template's parameters?

    Comment


      #3
      Hi,

      when I use this template with SampleAtmStrategy, It is working but for me throwing the error.

      Comment


        #4
        Hello bosajin,

        You are using exact prices instead of a number of ticks or amount of currency?

        Are you certain that these are valid prices?

        A buy stop order must have the stop price above the market price.
        A sell stop order must have the stop price below the market price.

        What is the current price when the stop is placed at 80.00 and the target is placed at 60.00?
        Is this is a short entry order?
        Is the current price below 80.00?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by zacharydw00, Today, 05:14 PM
        0 responses
        7 views
        0 likes
        Last Post zacharydw00  
        Started by shahabjet1, Today, 04:47 PM
        0 responses
        13 views
        0 likes
        Last Post shahabjet1  
        Started by aligator, Today, 04:32 PM
        0 responses
        12 views
        0 likes
        Last Post aligator  
        Started by timko, Today, 04:02 PM
        0 responses
        10 views
        0 likes
        Last Post timko
        by timko
         
        Started by asmmbillah, Today, 03:37 PM
        2 responses
        18 views
        0 likes
        Last Post asmmbillah  
        Working...
        X