Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit Error

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

    Limit Error

    I tried using this line of code in my strategy:

    LongOrder = EnterLongLimit(GetCurrentAsk(),"LongEntry")

    but got an error saying:

    'Rejected:Limit price cant be greater than current ask'. How do I fix this?

    Testig on forex using the Gain capital feed.

    Also how do I set lot sizes so for example 1 lot or 0.1 lot etc in my strategy? It mentions in the help files there is a difference between backtesting & real trading.

    #2
    Welcome to our support forums mballagan, please use GetCurrentBid() as the limit price for your long order. In backtesting you would enter for example 100000 as quantity for a standard lot and 10000 for a mini one. In live trading, you would use 1 as quantity to trade one lot in your account (standard or mini whatever is set per broker defaults for this live account).

    Comment


      #3
      limit order

      Thanks for your reply.

      However thought that if buying you would do this at the Ask price and therefore use GetCurrentAsk() rather than GetCurrentBid()?

      Comment


        #4
        mballagan,

        The problem is that you may have submitted at a certain ask, but the market moves fast and now the limit price you originally submitted at is no longer a valid price. I recommend you not to submit at such a close price because the possibility of such a fast move against you is always possible.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        27 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        117 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        69 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        226 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        417 views
        0 likes
        Last Post CaptainJack  
        Working...
        X