Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Placing SL Error

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

    Placing SL Error

    The problem in my strategy. Client requires small SL. So I do the following:
    1) Place Long Market Order @7777
    2) Then I try to place Stop Loss (Limit Order) - it should be placed @7776.25 but I try to place it, while price goes below SL price and I get error message: http://prntscr.com/obqldx

    How can I handle this? Is there a way to handle these errors like exceptions?

    #2
    Hello kujista,

    Are you ensuring the price for the order is greater/less than the ask/bid before the order is placed?

    It requires advanced logic, but you could ignore errors and resubmit the order at a valid price.
    https://ninjatrader.com/support/help...orhandling.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I am comparing it to closed, how do i access ask bid values

      Comment


        #4
        Hello kujista,

        I recommend that you ensure the price is a valid price before placing the order.

        if (myPrice < GetCurrentBid())
        {
        ExitLongStopLimit(myPrice, myPrice);
        }
        else
        {
        ExitLongStopLimit(GetCurrentBid() - TickSize, GetCurrentBid() - TickSize);
        }

        Below are links to the help guide on GetCurrentAsk() and GetCurrentBid().
        https://ninjatrader.com/support/help...currentask.htm
        https://ninjatrader.com/support/help...currentbid.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by 2inthebush, Today, 03:29 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by forrestang, Today, 02:17 PM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Bobbybattles, Today, 01:31 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by papaoutai, Today, 12:43 PM
        2 responses
        8 views
        0 likes
        Last Post papaoutai  
        Started by sdauteuil, Today, 12:16 PM
        0 responses
        6 views
        0 likes
        Last Post sdauteuil  
        Working...
        X