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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        72 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        39 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X