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

Changing Limit order to Price level

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

  • NinjaTrader_RyanL
    replied
    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.

    Leave a comment:


  • outsource
    replied
    Originally posted by NinjaTrader_PatrickH View Post
    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.
    Thanks,Patrick.I got the point,but have difficulties,technically to land that double.Like have errors here and there.Any 3-rd party you can recommend,who would assist?

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    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:


  • outsource
    replied
    Originally posted by NinjaTrader_Paul View Post
    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.
    Paul,i guess i`d need to replace the iFillOrders with sometthing else,so it just throws the price levels instead of limit orders,and so the strategy could read those levels and adjust the stop and target accordingly.is it ever feasible?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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:


  • outsource
    replied
    Originally posted by NinjaTrader_Paul View Post
    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
    Still hard to get,as im not a programmer,but try to guess:

    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:


  • NinjaTrader_PaulH
    replied
    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:


  • outsource
    replied
    Originally posted by NinjaTrader_Paul View Post
    Hello outsource,

    You would compare the oPrice to the current price and then submit, or not, the order.
    Hi,Paul,could you post an example,please?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello outsource,

    You would compare the oPrice to the current price and then submit, or not, the order.

    Leave a comment:


  • outsource
    replied
    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()));									
    									}
    								}
    I assume i need this line to exchange on just the price at this level,without the Limit order being submited:

    Code:
    tVars.iFillOrders.Add(SubmitOrder(sBIP, OrderAction.Buy, OrderType.Limit, tVars.qty[i], oPrice, 0, string.Empty, "Lmt_" + (i+1).ToString()));
    How can i do it?I can provide additional info, if needed.

    Thank you!
    Last edited by outsource; 06-07-2016, 08:46 PM.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    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:


  • outsource
    replied
    Originally posted by NinjaTrader_Paul View Post
    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.
    Hi,Paul,

    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:


  • NinjaTrader_PaulH
    replied
    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:


  • outsource
    started a topic Changing Limit order to Price level

    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 you

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 rene69851  
Started by gwenael, Today, 09:29 AM
0 responses
3 views
0 likes
Last Post gwenael
by gwenael
 
Started by Karado58, 11-26-2012, 02:57 PM
8 responses
14,829 views
0 likes
Last Post Option Whisperer  
Started by Option Whisperer, Today, 09:05 AM
0 responses
2 views
0 likes
Last Post Option Whisperer  
Started by cre8able, Yesterday, 01:16 PM
3 responses
11 views
0 likes
Last Post cre8able  
Working...
X