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
capture Strategy position ENTRY by bar
Collapse
X
-
capture Strategy position ENTRY by bar
in Strategy Wizard 'Condition and action' how can I determine when (current bar at close) the Strategy Action actualy 'Do' /Order management - Enter long position ?? I did try 'Define user variable' but this works as a toggle that once triped is always until reset.Tags: None
-
Hi Josh
I did use the Strategy Action to set a variable..trouble is the variable works as a toggle so "When following conditions are true", bar#5, to Enter long, on bar #6, the variable starts the value assigned in the 'define user variable' in "Do the following". However, because of the toggle action, the variable persists to bar #6,7,8,9,... until/if the variable is ever changed by another command.
Goal: In Strategy I have constructed 9 different sets that will 'Enter long'. What I am need to do is construct set#10 to 'Exit long' on only the very bar ,#7, following an 'Enter long' execution, bar#6, in a "stop run/head fake" scenario. (This scenario is easy to identify and extremely accurate, so saves a lot of pain in the stop loss area.) The Strategy is set to only be in one position at a time so I do not want/need to know "When following conditions" support 'Enter long' ; I need to define the actual bar the Strategy actually did 'Enter long',#6, so can/will only auto 'Exit long' on bar#7, if set#10 conditions form during bar#6, the actual bar of entry. FYI I am 'calculate on bar close' on tick data so is too fast for proper manual exit
Comment
-
Condition Builder / Strategy / Current position size: add bar enumerator
this is one thought . In the Condition Builder , In the Strategy field: Add a bar enumerator to the "Current position size". This would alow testing to locate position size changes +or- relative to a particular bar pair. A wider application would be to support all the values in the 'Strategy' field with the parameter "bar"
Comment
-
I see what you want to do now. Instead of using a variable you can use "Bars since entry". In the top Condition Builder part, expand the "Misc" category and select "Bars since entry", select >, then on the right hand side expand "Misc" again and this time select "Numeric Value", set it to however many bars after entry you want it to be at.
Then on the bottom select "Exit Long" as your action.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
9 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
14 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
||
Started by strategist007, Yesterday, 07:51 PM
|
0 responses
13 views
0 likes
|
Last Post Yesterday, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,983 views
3 likes
|
Last Post
by jhudas88
Yesterday, 06:59 PM
|
Comment