Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Problem with "OR"
Collapse
X
-
Hello tonynt,
Glad you could solve the issue.
Please let me know if I can assist you any further.
-
Thank you!
Originally posted by NinjaTrader_Joydeep View PostHello tonynt,
You should consolidate the OR logics as shown below.
if (tradecounterLP8 < maxtradesLP8 && Position.MarketPosition == MarketPosition.Flat
&&Rising(MACD(BarsArray[2],5, 20, 30).Avg) == true && (Rising(Stochastics(BarsArray[5],7,14,3).D) == true|| Rising(Stochastics(BarsArray[4],7,14,3).D) == true|| Rising(Stochastics(BarsArray[3],7,14,3).D) == true)
&& Close[1] < Open[1]
&& Close[0] > Open[0])
Please let me know if I can assist you any further.
Leave a comment:
-
Hello tonynt,
You should consolidate the OR logics as shown below.
if (tradecounterLP8 < maxtradesLP8 && Position.MarketPosition == MarketPosition.Flat
&&Rising(MACD(BarsArray[2],5, 20, 30).Avg) == true && (Rising(Stochastics(BarsArray[5],7,14,3).D) == true|| Rising(Stochastics(BarsArray[4],7,14,3).D) == true|| Rising(Stochastics(BarsArray[3],7,14,3).D) == true)
&& Close[1] < Open[1]
&& Close[0] > Open[0])
Please let me know if I can assist you any further.
Leave a comment:
-
Problem with "OR"
Hello,
when I add a condtion with "OR" (= "||") I get many entries in the script strategies. Everything works fine but when I add like herein this example some condtions with OR (in red color) then I have not 2 entries (limited with tradecounter) but 2011 entries. I do not understand what is wrong.
if (tradecounterLP8 < maxtradesLP8
&& Position.MarketPosition == MarketPosition.Flat
&&Rising(MACD(BarsArray[2],5, 20, 30).Avg) == true
&& Rising(Stochastics(BarsArray[5],7,14,3).D) == true|| Rising(Stochastics(BarsArray[4],7,14,3).D) == true|| Rising(Stochastics(BarsArray[3],7,14,3).D) == true
&& Close[1] < Open[1]
&& Close[0] > Open[0])
Thank you
TonyTags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
144 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
71 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
125 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
79 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Leave a comment: