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
How to tell if a stop loss/target has been hit in NinjaScrpt?
Collapse
X
-
imported post
Dierk Droth wrote:You could monitor Position.MarketPosition and Position.Quantity and check for changes in your OnBarUpdate method.
a) Is it not possible to access these fields any more?
b) If they are still accessible (and will remain in the forseeable future), what exactly do they return (i.e. I guess that Position.MarketPosition holds the total current position of the primary instrument - that is all filled orders, but what does Position.Quantity hold?).
c) are there other undocumented position related fields of interest for an automated strategy?
Thanks in advance for clarification.
Peter Lipa
PS: FYI, the current Nt6beta11 online docu http://www.ninjatrader-support.com/H...l?ReleaseNotes has some missing .jpg's in the updated NinjaScript Tutorial sections. The installed (local) docu, however,is fine.
Comment
-
imported post
See here - http://www.ninjatrader-support.com/H...tPosition.html
Thanks for the missing images comment.
Ray
RayNinjaTrader Customer Service
Comment
-
Query Stop Loss Event
Hi I am having the same stop loss query issue here. However, I am writing 2 independent strategies where I want to query for a stop loss within each strategy. For example if I use
if (Position.MarketPosition = MarketPosition.Flat)
is the above statement global or local in nature? If strategy#1 has an open position & strategy #2 just got stopped out when using the above line in strategy#2 give flat? If not, how to query for stoploss event WITHIN the strategy?
Comment
-
Originally posted by geekodude View PostHi I am having the same stop loss query issue here. However, I am writing 2 independent strategies where I want to query for a stop loss within each strategy. For example if I use
if (Position.MarketPosition = MarketPosition.Flat)
is the above statement global or local in nature? If strategy#1 has an open position & strategy #2 just got stopped out when using the above line in strategy#2 give flat? If not, how to query for stoploss event WITHIN the strategy?
Comment
-
Originally posted by geekodude View PostHi I am having the same stop loss query issue here. However, I am writing 2 independent strategies where I want to query for a stop loss within each strategy. For example if I use
if (Position.MarketPosition = MarketPosition.Flat)
is the above statement global or local in nature? If strategy#1 has an open position & strategy #2 just got stopped out when using the above line in strategy#2 give flat? If not, how to query for stoploss event WITHIN the strategy?
Another option is combining signals into one 'master' strategy so individual fills for each entry become querable.BertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by llanqui, Yesterday, 09:59 AM
|
3 responses
22 views
0 likes
|
Last Post
by llanqui
Today, 07:10 AM
|
||
Started by smartromain, 03-13-2024, 01:42 AM
|
5 responses
93 views
0 likes
|
Last Post
by AndreiBig
Today, 06:08 AM
|
||
Started by Noerclou, Today, 04:55 AM
|
0 responses
4 views
0 likes
|
Last Post
by Noerclou
Today, 04:55 AM
|
||
Started by ThoriSten, Today, 03:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by ThoriSten
Today, 03:56 AM
|
||
Started by PhillT, 04-19-2024, 02:16 PM
|
3 responses
26 views
0 likes
|
Last Post
by mangel2000
Today, 03:04 AM
|
Comment