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 TheTradingMantis, 10-31-2017, 03:18 PM
|
5 responses
1,251 views
0 likes
|
Last Post
by TheAngryCube
Today, 04:06 PM
|
||
Started by Padan, Today, 02:02 AM
|
9 responses
23 views
0 likes
|
Last Post Today, 03:27 PM | ||
Started by spottysallrite, Today, 11:31 AM
|
7 responses
22 views
0 likes
|
Last Post Today, 03:26 PM | ||
Started by nandhumca, Today, 03:15 PM
|
1 response
4 views
0 likes
|
Last Post Today, 03:23 PM | ||
Started by PopovDS, 03-11-2024, 12:49 PM
|
3 responses
17 views
0 likes
|
Last Post
by PopovDS
Today, 03:16 PM
|
Leave a comment: