Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Take long trade on green bar after every red bar pull back
Collapse
X
-
Take long trade on green bar after every red bar pull back
I am making a strategy where I want to take a long position when a green candle closes above the sma 9 while hma 30 is rising and vice versa for shorts. I have all that figured out and entered into the strategy builder. I need some help on getting the strategy to take a long position when the rules happen each time after a 2 or 3 red candle pullback. I used the SavedBar int but that doesnt seem to work. I have attached a picture of what I am trying to do.Tags: None
-
Hello Barrett,
Thanks for your post.
I would suggest using a bool to control when you are allowed to enter a long or short trade, and to change EntriesPerDirection and EntryHandling in the Default Properties page of the Strategy Builder to allow entering multiple times in the same direction.
The bool can start as true, and be set to false when your entry order is submitted. The bool can be reset back to true when you see a pullback, or when the Strategy Position is flat.
Please see the conditions and actions examples below to see how you can make position checks.
Conditions - https://ninjatrader.com/support/help...on_builder.htm
Actions - https://ninjatrader.com/support/help...t8/actions.htm
As an example, your pullback conditions can be modelled by looking at the last 3 bars to see if 2 bars ago is green (Close[2] > Open[2]), if 1 bar ago is green (Close[1] > Open[1]), and if the current bar is red (Close[0] < Open[0])
We look forward to assisting.
-
Hello Barrett,
The specific entry conditions may need additional logic so they are taken (as an example) if the strategy is already in a position, or if the strategy is flat. Additional checks on other bar price levels can be used to further narrow your entry conditions. The Conditions examples can share how to make position checks if you would like to use that criteria with your entry signals.
You could consider using the Slope which can be used with an indicator as input to see if the indicator plot is rising or falling. You could also consider using IsRising and IsFalling. Slope, Rising and Falling can be found under Misc in Conditions.
When building new conditions, it can help to make an action that prints the value you want to use so you can see how you may model your logic.
Comment
-
Hello Barrett,
This would require coming up with logic to differentiate between regular entries, and re-entries, or more simply: "Any action to enter, we control by logic, and if those conditions conflict with other conditions, we will need to think of a way to differentiate these separate cases with stricter logic." The changes involved may be more complicated, but for the idea of separating entries from re-entries, you can consider creating different sets of logic that check: if the strategy is flat: Enter, and: if the strategy is Long: submit our second long entry.I understand this but there will be a problem when its 2 green bars right after the red bar before the signal bar. Im not sure how to get past that.
An example for checking the strategy position can be found here - https://ninjatrader.com/support/help...ionComparisons
I had suggested using Slope or using Rising and Falling to identify if an indicator plot value is rising falling or flat. If the plot is neither Rising or Falling it would be flat.Also is there a way I could have the HMA be either rising or flat and falling or flat?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
29 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment