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
Getting expiry of Contract
Collapse
X
-
Getting expiry of Contract
How can I access the expiry information of a contact that is not the primary contract in a multi series script. For the primary contract I am using Instrument.Expiry.Month.Last edited by GKonheiser; 01-09-2014, 03:08 AM.Tags: None
-
would that be the same for Position
ie if I have a added FGBL with index location 3, can I use Position[3].MarketPosition == MarketPosition.Flat?
Comment
-
Correct, that would provided access to the Positons array for your script - this is also fully documented with an example here in our helpguide - http://www.ninjatrader.com/support/h.../positions.htmBertrandNinjaTrader Customer Service
Comment
-
Hi Bertrand,
Thanks for your help on this this morning.
Is there anything I need to take into account when writing the OnOrderUpdate for the second contract
ie if (order.OrderState == OrderState.Cancelled && order.Filled == 0),
will there be any confusion with the primary contracts orders, ie what if both contracts get a fill at the same time?
Same for OnExecution when checking for executions what if there are two fills at the same time, what happens to execution.Order.OrderState ?Last edited by GKonheiser; 01-09-2014, 07:40 AM.
Comment
-
That would be dependent upon which IOrder object you set your OnOrderUpdate code to listen to, its per default called for all.
i.e. if (entryOrder != null && entryOrder == order) with this check you would only apply the following logic / check then for the entryOrder object.BertrandNinjaTrader Customer Service
Comment
-
OK, Sorry for my ignorance, but if I have a multi series script and I get two fills at the same time for two different contracts say two iOrders, longBund and longBobl , and I do a check for longBund == execution.order and longBobl == execution.order would they both come back as true, ie can execution.order be for more then one order?? does that make sense?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by FishTrade, Yesterday, 11:11 PM
|
3 responses
10 views
0 likes
|
Last Post
by FishTrade
Today, 11:09 PM
|
||
Started by Graci117, Today, 09:02 PM
|
1 response
10 views
0 likes
|
Last Post Today, 09:09 PM | ||
Started by ETFVoyageur, Today, 07:55 PM
|
0 responses
8 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:55 PM
|
||
Started by janio973, Today, 07:24 PM
|
1 response
7 views
0 likes
|
Last Post Today, 07:35 PM | ||
Started by aligator, 01-06-2022, 12:14 PM
|
4 responses
248 views
0 likes
|
Last Post
by john_44573
Today, 06:11 PM
|
Comment