NexusFi: Find Your Edge


Home Menu

 





Multiple order execution


Discussion in NinjaTrader

Updated
    1. trending_up 1,060 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Multiple order execution

  #1 (permalink)
 olres7 
Gatlinburg TN/USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Futures
Posts: 12 since Sep 2015
Thanks Given: 5
Thanks Received: 0

Hi there!

I have a question. How to do multiple orders with IOrder null?

Here is my code:

private IOrder myEntryOrder = null;
protected override void OnBarUpdate()
{
// Submit an entry order at the low of a bar
if (myEntryOrder == null &&
High[0] > MAX(High, 30)[1] &&
Range()[0] <= 13*TickSize)
{
myEntryOrder = EnterShortLimit(0, true, 1, High[0], "Long Entry");

}
}

protected override void OnOrderUpdate(IOrder order)
{
if (myEntryOrder != null && myEntryOrder == order)
{
if (order.OrderState == OrderState.Filled)
entryOrder = null;
}
}

myEntryOrder = EnterShortLimit(0, true, 1, High[0], "Entry1");

I want to add 2 more EnterShortLimit orders with the same entry rules. How can I do that?
Do I need to add 2 more objects like myEntryOrder1 and myEntryOrder2?
How can I manage them in OnOrderUpdate?


private IOrder myEntryOrder = null;
protected override void OnBarUpdate()
{
// Submit an entry order at the low of a bar
if (myEntryOrder == null &&
High[0] > MAX(High, 30)[1]
Range()[0] <= 13*TickSize)
{
myEntryOrder = EnterShortLimit(0, true, 1, High[0], "Entry1");
? = EnterShortLimit(0, true, 1, High[0] - 2*TickSize, "Entry2");
? = EnterShortLimit(0, true, 1, High[0] - 4*TickSize, "Entry3");

}
}

Pls help me to figure out
Thanks,
Serge

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Quant vue
Trading Reviews and Vendors
NexusFi Journal Challenge - May 2024
Feedback and Announcements
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Yes make 2 extra object to store the order 2 & 3

And make 2 extra if's

Test all on market replay..

Good luck

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on October 20, 2015


© 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