Console.WriteLine(c.Command("PLACE", "Sim101", "ES 09-20", "SELL", 1, "STOPMARKET", 0, 3155, "DAY", "12", "12", "", "").ToString());
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Placing short orders through NinjaTrader.Client assembly, raises error for stop loss
Collapse
X
-
Placing short orders through NinjaTrader.Client assembly, raises error for stop loss
Hi, I'm trying to place orders through de NinjaTRader.Client dll and I have encountered the problem that, if I place the order to sell a future and set the stop above the current price, ninjatrader raises an error indicating that stops above the current price are not supported..???? Is that possible? I'm using the Sim101 account.... Thanks in advance for any tips...
Console.WriteLine(c.Command("PLACE", "Sim101", "ES 09-20", "SELL", 1, "STOPMARKET", 0, 3155, "DAY", "12", "12", "", "").ToString());Tags: None
-
Hello abner77,
A buy stop order must be above the ask, a sell stop order must be below the bid.
This is also true if you pick up the phone and call your broker.
If you are wanting to place a sell order above the bid, you would need to use a limit order or a market if touched order.Last edited by NinjaTrader_ChelseaB; 07-09-2020, 09:35 AM.Chelsea B.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_ChelseaB View PostHello abner77,
A buy stop order must be above the ask a sell stop order must be below the bid.
This is also true if you pick up the phone and call your broker.
If you are wanting to place a sell order above the bid, you would need to use a limit order or a market if touched order.
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello abner77,
When in a short position a stop market order used as a stop loss would be a buy order and not a sell order.
A buy order is used to exit a short position.
A buy stop market must be above the current ask price.
What does STOPMARKET then do? I have upload an image with the ninjatrader.Client help that it's relevant to this question...
1 Photo
Comment
-
Hello abner77,
Below is a link to the help guide with the available command parameters.
https://ninjatrader.com/support/help...ableToCommands
As well as a link the help guide with a list of available functions.
https://ninjatrader.com/support/help.../functions.htm
PLACE would be used to submit an order.
As an example:
SubscribeMarketData();
double currentAskPrice = MarketData("ES 09-20", 2);
Command("PLACE", "Sim101", "ES 09-20", "BUY", 1, "STOPMARKET", 0, (currentAskPrice + 1),
"DAY", string.Empty, NewOrderId(), string.Empty, string.Empty)Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello abner77,
Below is a link to the help guide with the available command parameters.
https://ninjatrader.com/support/help...ableToCommands
As well as a link the help guide with a list of available functions.
https://ninjatrader.com/support/help.../functions.htm
PLACE would be used to submit an order.
As an example:
SubscribeMarketData();
double currentAskPrice = MarketData("ES 09-20", 2);
Command("PLACE", "Sim101", "ES 09-20", "BUY", 1, "STOPMARKET", 0, (currentAskPrice + 1),
"DAY", string.Empty, NewOrderId(), string.Empty, string.Empty)
Last edited by abner77; 07-09-2020, 11:18 AM.
Comment
-
Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello abner77,
Do you have NinjaTrader 7 open?
I'm finding the code I have suggested is working without issue.
Below is a link to a video.
And a link to a forum post on the API.
https://ninjatrader.com/support/foru...626#post793626
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello abner77,
Do you have NinjaTrader 7 open?
I'm finding the code I have suggested is working without issue.
Below is a link to a video.
And a link to a forum post on the API.
https://ninjatrader.com/support/foru...626#post793626
Comment
-
Hello abner77,
I just wanted to clarify, were you able to try doing the test that Chelsea had provided a video of despite it not necessarily being valid or not?
The purpose of that was simply to put the order in and see it in the platform as a demonstration. You mentioned that the platform did nothing when you submitted the order so this test helps to make sure the platform is able to see an order come through.
I would suggest to go from the sample like shown in the video to test the API. If something you try after that point stops working you can know it was because of the code you used and not something else. A nothing result wouldn't be expected so making sure the connection is established and working is a good starting point.
JesseNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jesse View PostHello abner77,
I just wanted to clarify, were you able to try doing the test that Chelsea had provided a video of despite it not necessarily being valid or not?
The purpose of that was simply to put the order in and see it in the platform as a demonstration. You mentioned that the platform did nothing when you submitted the order so this test helps to make sure the platform is able to see an order come through.
I would suggest to go from the sample like shown in the video to test the API. If something you try after that point stops working you can know it was because of the code you used and not something else. A nothing result wouldn't be expected so making sure the connection is established and working is a good starting point.
These are working no problems so far (see image attached):
1 Photo
Comment
-
Hello abner77,
I tried this myself using the video steps and I can see stop market orders working on my end just like the video. I would suggest to save what you have as a zip excluding all the build data and attach it as a sample so we can review that before we continue further.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jesse View PostHello abner77,
I tried this myself using the video steps and I can see stop market orders working on my end just like the video. I would suggest to save what you have as a zip excluding all the build data and attach it as a sample so we can review that before we continue further.
I look forward to being of further assistance.
Attached Files
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 03:49 AM
|
0 responses
7 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
9 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
10 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
||
Started by dustydbayer, Today, 01:59 AM
|
0 responses
4 views
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 12:32 AM |
Comment