Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How can I include "flat" MA conditions in strategy?
Collapse
X
-
Sorry I don't follow you - if the slope is a consideration for an entry signal, then it would automatically not take any trades in your designated MA flat area, as simple no condition for entry would evaluate to 'true' and thus trigger an entry into the market by your strategy. You don't have to tell it not to enter, it would not enter if none of the conditions triggered.
-
Hi Bertrand,
The flat ma slope conditions are not entry signals, they are the opposite. They are signals not to trade:
Entry signal:
if (ZeroLagTEMA(ZLTEMA).ZeroTEMA[0] >ZeroLagHATEMA(ZLHATEMA).ZeroHATEMA[0]
&& Position.MarketPosition == MarketPosition.Flat
&& (Rising(anap)
&& Close[0] > ZeroLagHATEMA(ZLHATEMA).ZeroHATEMA[0]))
GoLong();
Signal NOT to trade:
if (Slope(anaHoltEMA(80, 20).HoltEMA, 5, 0) < 0.00091
&& Slope(anaHoltEMA(80, 20).HoltEMA, 2, 0) > -0.003)
Comment
-
Shadowshorter, you would need to include your Slope condition in the entry, otherwise it would not work as filter, a signal not to take a trade is no signal...
if (Slope(anaHoltEMA(80, 20).HoltEMA, 5, 0) < 0.00091
&& Slope(anaHoltEMA(80, 20).HoltEMA, 2, 0) > -0.003)
Change the thresholds / comparisons for the slope so you filter for the slope conditions that would allow an entry then, so inverse basically of your current logic.
Comment
-
Hi Bertrand,
I was trying this but I can't seem to find the opposite settings to my ma flat conditions.
Will keep trying, thanks for all your time, you've been very helpful
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
66 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment