Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trades get filled in mid air!

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

    Trades get filled in mid air!

    Hi,

    I notice an issue in NT where I set an order to fill if price meets a certain value,
    and sometimes the order is filled before that value is reached i.e. in midair!

    E.g. in screenshot above (ignore all the indicator decorations) look at 21st.
    The position is enetered in midair at 1473.50!

    Ok, on the 20th, a limit order was set to trigger the next day if price hit value 'myEntry' which was 1473.50
    myEntry = 1473.50
    EnterLongLimit(1, myEntry, sigName);

    So why did order get filled?

    Any help would be very much appreciated.

    Thank-you!
    Attached Files

    #2
    regikeyz, I would expect - as the limit order will be marketable (just as in real life), so could be filled immediately if you submit at a higher than the current price, just in back-testing we will be conservative and give you the price specified. Order type wise I think you really seek to use a long-stop limit order here, a limit order activated only at a certain higher price (for buys) by a stop order.

    Comment


      #3
      Look at the log and the prices/times there.

      Comment


        #4
        Hi Sledge:
        Re logs and times, there was no error with this particular trade, tho I saw errors with other trades I wasn't aware about. Thanks for suggestion.

        Hi Bertrand, thank-you for explaining in backtesting you give price specified. Though you mention this is 'conservative' actually it seems very generous! (Is there a way to default to using more conservative parameters?)

        1) Please could you explain how to use a long-stop-limit order, I've been looking it up, I don't understand why I need two values for stop and limit, can I set to same value?
        2) Just to clarify, sometimes I may want to place an order to buy if the price drops to a point below current place in market, and sometimes I want to buy if price rises to a point above the current market. Would I need to detect this and create either a stop or limit order based on circumstance? Or is there a way where this is just done automatically?

        Thank-you Kindly

        Comment


          #5
          regikeyz,

          You would need to specify two values, as that's how a limit order combined with a stop would work - you need to specify at which price the stop is to activate the order and then how much you're willing to accept to pay for the entry...the limit portion, up to which price it can fill you. They could be at the same price yes.

          Buy order with a stop portion could not be placed below the current market, so yes you want to use a regular limit order in this case then.

          Perhaps that tip in general can help on the different order types possible to use -

          Comment


            #6
            great thank-you!
            just reading it all now and in process of modifying my code!
            thanks

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            367 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            571 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X