Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Error : Order price too far from market price with SP500

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

    Error : Order price too far from market price with SP500

    Hello Ninjatrader community,

    I developed an automated strategy, and it usually works very well.

    However, when I try to run my strategy on @SPX500, I always get the same errors : "Order price too far from market price (...)" AND "Order rejected (...)".

    Whats happens is that the strategy places an order, and reject it a few seconds later.

    If I run my strategy with any other pair (US30, GBPJPY, ...), it works well, I get no errors.

    I attached 2 images, one that shows the 2 pop-up errors, and one that shows my Log file.

    I don't know if this can help, but my code uses the OnBarUpdate() method, and my orders are sent using the EnterLong() method.

    Also, my data provider is FXCM.

    I noticed that the pip value of a certain period of SP500 in Ninjatrader is 50 pips, while the exact same period in FXCM shows 500 pips. Could this be part of the problem ?!

    Thank you very much, and happy holidays.

    Alex
    Last edited by alexismailhot; 12-27-2018, 03:01 PM.

    #2
    Hello alexismailhot,

    Thanks for your post.

    We can see the rejection is coming from a Sell limit order, and aligns with the submission of your Profit target order which was submitted to 10146.64. FXCM then rejected this order with the native error that it is too far away from the market.

    Before we get into pip sizes, could you share how you are using SetProfitTarget where it submits the sell limit order that far from the market price?

    I look forward to your reply.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello Jim,

      In fact this is my error, I had a conversion problem when using the StopLoss and ProfitTarget with SP500.

      Thank you very much, everything works fine now!

      Alex

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kujista, Today, 06:23 AM
      0 responses
      1 view
      0 likes
      Last Post kujista
      by kujista
       
      Started by traderqz, Yesterday, 04:32 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by f.saeidi, Today, 05:56 AM
      1 response
      5 views
      0 likes
      Last Post Jltarrau  
      Started by Jltarrau, Today, 05:57 AM
      0 responses
      5 views
      0 likes
      Last Post Jltarrau  
      Started by Stanfillirenfro, Yesterday, 09:19 AM
      7 responses
      53 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X