• 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

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 StevenNelson, Today, 04:07 PM
        0 responses
        3 views
        0 likes
        Last Post StevenNelson  
        Started by Matthew Spositi, Today, 03:28 PM
        2 responses
        5 views
        0 likes
        Last Post Matthew Spositi  
        Started by faisamtrader, Today, 01:30 PM
        2 responses
        19 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by idangre, 12-08-2016, 10:37 AM
        3 responses
        543 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by priceisking, Today, 11:30 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X