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!
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
NinjaTrader
Changing Limit order to Price level
Collapse
X
-
Hello outsource,
Thank you for the follow up.
I have provided a link below that will show you the NinjaTrader Ecosystem partners that provide NinjaScript Consulting services, you will need to contact each partner and inquire further regarding the quotes for prices for your custom NinjaScript ideas and work with the consultant directly:
Please let me know if you have any questions, concerns or if I can provide any further assistance by responding to this thread at your convenience.
-
Originally posted by NinjaTrader_PatrickH View PostHello outsource,
There a few ways to approach this. We provided a simpler approach that you can use. You are correct in that you would not use the actual SubmitOrder method to submit the limit orders but rather just use doubles to hold the prices that you would have submitted the limit orders to. Then compare those doubles to the current price as seen in Paul's prior example.
Leave a comment:
-
Hello outsource,
There a few ways to approach this. We provided a simpler approach that you can use. You are correct in that you would not use the actual SubmitOrder method to submit the limit orders but rather just use doubles to hold the prices that you would have submitted the limit orders to. Then compare those doubles to the current price as seen in Paul's prior example.
Leave a comment:
-
Originally posted by NinjaTrader_Paul View PostHello outsource,
Thanks for your reply.
Here is another example you might consider:
double myPriceProfitLevel = 1200; // this is just an example variable use your oPrice here instead
if (Position.MarketPosition == MarketPosition.Long
&& Close[0] >= myPriceProfitLevel)
{
// adjust your stop order
}
if (Position.MarketPosition == MarketPosition.Short
&& Close[0] <= myPriceProfitLevel)
{
// adjust your stop order
}
Please note that NinjaTrader does not provide coding or debugging services. We can provide references to 3rd party coders that can assist you with these needs upon your request.
Leave a comment:
-
Hello outsource,
Thanks for your reply.
Here is another example you might consider:
double myPriceProfitLevel = 1200; // this is just an example variable use your oPrice here instead
if (Position.MarketPosition == MarketPosition.Long
&& Close[0] >= myPriceProfitLevel)
{
// adjust your stop order
}
if (Position.MarketPosition == MarketPosition.Short
&& Close[0] <= myPriceProfitLevel)
{
// adjust your stop order
}
Please note that NinjaTrader does not provide coding or debugging services. We can provide references to 3rd party coders that can assist you with these needs upon your request.
Leave a comment:
-
Originally posted by NinjaTrader_Paul View PostHello outsource,
Thanks for your post.
An example would be if-then-else statement.
if (condition to be evaluated)
{
// take some action if evaluated condition is true
}
else
{
// take other action if evaluated condition false
}
reference: http://ninjatrader.com/support/helpG...g_commands.htm
Will that one work?
Code:for(int i = 0 ; i < tVars.qty.Length ; i++) { double oPrice = Position.AvgPrice - (Position.AvgPrice * (tVars.interval[i] / 100)); if(tVars.qty[i] != 0) tVars.iFillOrders.Add(SubmitOrder(sBIP, OrderAction.Buy, OrderType.Limit, tVars.qty[i], oPrice, 0, string.Empty, "Lmt_" + (i+1).ToString())); else if(tVars.qty[i] == 0) double oPrice = Position.AvgPrice - (Position.AvgPrice * (tVars.interval[i] / 100)); }
But it doesnt compile.Please,corret me.
Leave a comment:
-
Hello outsource,
Thanks for your post.
An example would be if-then-else statement.
if (condition to be evaluated)
{
// take some action if evaluated condition is true
}
else
{
// take other action if evaluated condition false
}
reference: http://ninjatrader.com/support/helpG...g_commands.htm
Leave a comment:
-
Hello outsource,
You would compare the oPrice to the current price and then submit, or not, the order.
Leave a comment:
-
Hey,guys,
here is the snippet in which i need a change:
Code:if(this.iFirstOrderType == eFirstOrderType.MARKET) { if(Position.MarketPosition == MarketPosition.Long) { for(int i = 0 ; i < tVars.qty.Length ; i++) { double oPrice = Position.AvgPrice - (Position.AvgPrice * (tVars.interval[i] / 100)); if(tVars.qty[i] != 0) tVars.iFillOrders.Add(SubmitOrder(sBIP, OrderAction.Buy, OrderType.Limit, tVars.qty[i], oPrice, 0, string.Empty, "Lmt_" + (i+1).ToString())); } }
Code:tVars.iFillOrders.Add(SubmitOrder(sBIP, OrderAction.Buy, OrderType.Limit, tVars.qty[i], oPrice, 0, string.Empty, "Lmt_" + (i+1).ToString()));
Thank you!Last edited by outsource; 06-07-2016, 08:46 PM.
Leave a comment:
-
Hello outsource,
Thanks for your reply.
It sounds like you need not submit the Profit Target and just use a double to track what price it would be at.
Leave a comment:
-
Originally posted by NinjaTrader_Paul View PostHello outsource,
Thanks for your post.
I do not understand what you are asking for but it sounds like you are wanting to monitor the price and then adjust your limit order?
You may want to add some clarity with a screenshot illustrating what you want to do.
No,i want to adjust stop and profit taking when the level is reached.I have so far the limit order in place along side the market order,that triggers the adjustment,but i dont want the additional dangling order,as i have the profit and stops the same size.So,when the limit is triggered i have the target nearby the entry(1+tick),but stop adjusts just slightly to avoid slippage and latency etc cetera...All in all,when i have the limit triggerd,i have two orders where the target is one tick,but the stop is slightly more,so what i need now,is to get rid of the limit order and to keep just the price ;evel instead,so when the price level is triggered it would be equal to the limit order,only the limit won`t be filled now.
I can provide the snippet from the execution framework if necessary.
Leave a comment:
-
Hello outsource,
Thanks for your post.
I do not understand what you are asking for but it sounds like you are wanting to monitor the price and then adjust your limit order?
You may want to add some clarity with a screenshot illustrating what you want to do.
Leave a comment:
-
Changing Limit order to Price level
Hello,Support!
My strategy has two options for Market and Limit orders and initiates both or just Market or just Limits(by choice).the question is how do i change the Limit order for the price level,where the limit is supposed to be,but i don`t want it to be placed,but instead the price to touch that level?
The logic is when the Limit orders are filled,the stops levels adjusts,so i just want the price level to be touched to adjust the stop without Limits being filled.
Thank youTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
||
Started by gwenael, Today, 09:29 AM
|
0 responses
3 views
0 likes
|
Last Post
by gwenael
Today, 09:29 AM
|
||
Started by Karado58, 11-26-2012, 02:57 PM
|
8 responses
14,829 views
0 likes
|
Last Post Today, 09:09 AM | ||
Started by Option Whisperer, Today, 09:05 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 09:05 AM | ||
Started by cre8able, Yesterday, 01:16 PM
|
3 responses
11 views
0 likes
|
Last Post
by cre8able
Today, 08:28 AM
|
Leave a comment: