Thank you!
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
Time Range High/Low Breakout in Strategy Builder
Collapse
X
-
Time Range High/Low Breakout in Strategy Builder
Hello! I would like to know how to enter a position at the break of the high or low of a predefined time range (like the opening range). In strategy builder I figured out how to define the time range but I don't know how to enter a position when price breaks above/below the high/low of that range. I guess I have to define the high and low of that range and then make a condition for the breakout but I can't figure out how..
Thank you!
Tags: None
-
Hi nothingtrader,
ONE of the options to accomplish this with the StrategyBuilder could be to do the following:
Step 1) Add two variables of type double, a) dRangeHigh, b) dRangeLow,
Step 2) Reset them to zero at the start of each trading day,
Step 3) During the time of the opening range, set/update dRangeHigh and dRangeLow as needed, i.e. if
i) dRangeHigh == 0, set dRangeHigh to High[0], else if dRangeHigh > 0 AND dRangeHigh < High[0], set/update dRangeHigh to High[0],
ii) dRangeLow == 0, set dRangeLow to Low[0], else if dRangeLow > 0 AND dRangeLow > Low[0], set/update dRangeLow to Low[0].
The variable dRangeHigh will (in general) continue to increase during the range time and dRangeLow will, once initialized, (in general) continue to decrease during the range time.
Step 4) Apply your other entry logic, for example:
Time > end of opening range time AND High[0] > dRangeHigh, Go Long (or speculate on turnaround and Go Short)
Time > end of opening range time AND Low[0] < dRangeLow, Go Short (breakout in trend direction, or speculate on turnaround and Go Long).
I hope, this clarifies the concept of ONE of the options.
Have fun.
NT-Roland
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
55 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
3 responses
9 views
0 likes
|
Last Post Today, 03:23 PM | ||
Started by jordanq2, Today, 03:10 PM
|
2 responses
8 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
47 views
0 likes
|
Last Post Today, 02:36 PM |
Comment