Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

weird trade

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

    weird trade

    Hi,
    I am developping some strategies with NT, and got some issues:
    Let's assume I am trading the EURUSD, and buy when the price is 1.0000 an using the EnterLong method. I can guess why I am executed at 1.005 (or any other price), but not why the managed approach doesn't signal any error while my profit target is less than the initial price and why the order isn't cancelled because the price is higher than my profit target.
    The second thing is that I can't for some reasons, use the enterlimit methods. how can I do to be sure that my price of execution won't be far from the price I want.

    Thank you,
    R.E.
    Last edited by snoppss; 08-03-2015, 10:26 AM.

    #2
    Hello R.E.,

    Thank you for writing in. Normally the profit target and stop loss do not get submitted until the entry order has been filled. This is why your entry order does not get cancelled when the market passes your profit target (because is hasn't been submitted yet). The only two order types that will make sure your order will be filled at a certain price are limit and stop limit however. When your conditions are met, simply use EnterLongLimit with something like the current bid price instead of EnterLong. For example:
    Code:
    EnterLongLimit(GetCurrentBid(), "limitEntry");
    Please see our help guide for more information on working with EnterLongLimit(): http://ninjatrader.com/support/helpG...enterlonglimit

    Please let me know if you have any further questions.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Hi,

      Thank you for your answer, but I still get some issues.
      When I use some code like yours I got an error because market is moving too fast.
      The error is "the strategy XXX submitted an order that gerenated the following error 'ErrorRejected'..." The problem is that when my order is executed the current bid has changed.
      How can I do to fix this?

      Thank you in advance,
      R.E.

      Comment


        #4
        Hello R.E.,

        The easiest way to prevent this is just to change the price you are entering at to the price you would attempt to enter at if you were placing a market order:
        Code:
        EnterLongLimit(GetCurrentAsk(), "limitEntry");
        Please let me know if this does not resolve the issue.
        Michael M.NinjaTrader Quality Assurance

        Comment


          #5
          Hi,
          Thank you for your answer,

          The problem is that in my code I use a lot of calculations so I think that when the broker got my order it's too late because I am always rejected doing this.

          Thank you in advance,
          R.E.

          Comment


            #6
            Hello R.E.,

            You need to use a limit order if you want only a certain price or better. To test if your logic is causing the limit order to be rejected, please make a new strategy with very basic logic that only does something like:

            Code:
            if(Rising(Close))
                EnterLongLimit(GetCurrentAsk(), "limitEntry");
            and check if it causes rejected orders. If that is the case, you will likely want to check your connection to your broker and if it is good, then make adjustments to the price you are setting the limit to so it doesn't get rejected. If it does not give you rejections, then there is something in your original code that you will need to debug to figure out what is causing the issue.

            Please let me know if I may be of further assistance.
            Michael M.NinjaTrader Quality Assurance

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            558 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            324 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            545 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X