NexusFi: Find Your Edge


Home Menu

 





Programmed Order Entry


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one traderap101 with 4 posts (0 thanks)
    2. looks_two TigerStripes with 2 posts (0 thanks)
    3. looks_3 jalley with 2 posts (1 thanks)
    4. looks_4 Dimitrio with 1 posts (1 thanks)
    1. trending_up 2,434 views
    2. thumb_up 2 thanks given
    3. group 5 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread

Programmed Order Entry

  #1 (permalink)
 jalley 
La Grange, CA USA
 
Experience: Intermediate
Platform: Ninjatrader, MetaTrader
Broker: NinjaTrader Brokerage
Trading: MES, MNQ, M2K, MYM
Posts: 25 since Jun 2020
Thanks Given: 14
Thanks Received: 7

Having trouble with StopLimit Orders...

Getting this error:
Buy stop or buy stop limit orders can't be placed below the market. affected Order: Buy 1 StopLimit @ -2x3445.75.

The current market was 3444.50 which this stop limit order was above not below like the error states. The code I tried is below here:

stopOrder = myAccount.CreateOrder(chartTrader.Instrument, OrderAction.Buy, OrderType.StopLimit, OrderEntry.Manual, TimeInForce.Gtc, qty, offsetPrice, 0, ocoGuid.ToString(), "stopOrder", Core.Globals.MaxDate, null);

myAccount.Submit(new[] { stopOrder });

I tried exactly as one of Ninjatraders Stop Market Order example and it also throws this error.

Regular Market and Limit Orders work fine for me...

entryOrder = myAccount.CreateOrder(chartTrader.Instrument, OrderAction.Buy, OrderType.Market, OrderEntry.Manual, TimeInForce.Gtc, qty, price, 0, ocoGuid.ToString(), "Entry", Core.Globals.MaxDate, null);

myAccount.Submit(new[] { entryOrder });

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
Dimitrio
Kyiv, Ukraine
 
Posts: 2 since Feb 2020
Thanks Given: 1
Thanks Received: 1

Log values of your variable offsetPrice and the current Ask to understand if the order can be set. And check the point when you calculate your offsetPrice to take into account a bid-ask spread.

Reply With Quote
Thanked by:
  #3 (permalink)
 jalley 
La Grange, CA USA
 
Experience: Intermediate
Platform: Ninjatrader, MetaTrader
Broker: NinjaTrader Brokerage
Trading: MES, MNQ, M2K, MYM
Posts: 25 since Jun 2020
Thanks Given: 14
Thanks Received: 7


Actually I had a buy stop limit way above the bid and ask and sent a log to NinjaTrader and got this response..(Basically Not Supported Yet)

https://forum.ninjatrader.com/forum/ninjatrader-8/indicator-development/1125950-having-trouble-creating-stopmarket-and-stoplimit-orders

I do know that vendors have implemented it, so they have found a workaround. I tried from both a strategy and from an indicator until I finally contacted NinjaTrader Support.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
traderap101
London UK
 
Posts: 18 since Jul 2022
Thanks Given: 3
Thanks Received: 16

Did you ever figure out a workaround for this restriction? Is there any documentation of how to use the CustomOrder parameter?

Reply With Quote
  #5 (permalink)
 TigerStripes   is a Vendor
 
Posts: 109 since Mar 2021
Thanks Given: 33
Thanks Received: 56

it is possible the work around does work on some routes but not all, as well as some connections and not all. This may cause them to not add to the recent platform update.

Reply With Quote
  #6 (permalink)
traderap101
London UK
 
Posts: 18 since Jul 2022
Thanks Given: 3
Thanks Received: 16

You can manually, without any restrictions, place stop limit order with improved limit prices on the Basic Entry window. These appear on the Orders list (State = Triggered) and on chart trader (yellow price line). They are done as simulated stop limit orders.

See the NT8 help guide for Simulated Stop orders.

So they do have the code in place to deal with this. However its bizarre, why NinjaScript API has been restricted to only allow limit price equivalent or worse than stop price.

Based on the NinjaTrader support response if anyone knows the structure to be supplied for CustomOrder when calling CreateOrder then please do share here or in private.

Reply With Quote
  #7 (permalink)
traderap101
London UK
 
Posts: 18 since Jul 2022
Thanks Given: 3
Thanks Received: 16

Just posted a solution to this on the NinjaTrader Forum. Unfortunately I cannot post the link here as I have only made 2 posts so far and links can only be done after 5 posts.

So just search for "Simulated Stop Limit order error" on the NinjaTrader Support Forum and look for post #12

Reply With Quote
  #8 (permalink)
 TigerStripes   is a Vendor
 
Posts: 109 since Mar 2021
Thanks Given: 33
Thanks Received: 56


traderap101 View Post
Just posted a solution to this on the NinjaTrader Forum. Unfortunately I cannot post the link here as I have only made 2 posts so far and links can only be done after 5 posts.

So just search for "Simulated Stop Limit order error" on the NinjaTrader Support Forum and look for post #12

What are benefits use a simulated stop, less latency when removing or improving the pricing I guess.

Reply With Quote
  #9 (permalink)
traderap101
London UK
 
Posts: 18 since Jul 2022
Thanks Given: 3
Thanks Received: 16

I actually trade Equities using NT8, so some stocks can have wide bid/ask spread. So rather than entering using a Market order. I look to enter on the price I want which can be either a few ticks above (for a Buy) or below (for a Sell) the stop trigger price if its a fast moving price action or many times below (for Buy) or above (for Sell) for a price improvement where I expect a retrace before continuation of the trend.

Reply With Quote




Last Updated on August 28, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts