NexusFi: Find Your Edge


Home Menu

 





Multiple order execution


Discussion in NinjaTrader

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




 
Search this Thread
  #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?
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Daytrading to swingtrading
Traders Hideout
Trump Media to sell instant access to market-moving soci …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
  #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: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,855


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 X Visit my NexusFi Trade Journal Reply With Quote




Last Updated on October 20, 2015


© 2026 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 - Downloads - Top
no new posts