Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with "OR"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NinjaTrader_Joydeep
    replied
    Hello tonynt,
    Glad you could solve the issue.
    Please let me know if I can assist you any further.

    Leave a comment:


  • tonynt
    replied
    Thank you!

    Originally posted by NinjaTrader_Joydeep View Post
    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:


  • NinjaTrader_Joydeep
    replied
    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:


  • tonynt
    started a topic Problem with "OR"

    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
    Tony

Latest Posts

Collapse

Topics Statistics Last Post
Started by Mindset, 04-21-2026, 06:46 AM
0 responses
101 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
144 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
71 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
125 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
79 views
0 likes
Last Post PaulMohn  
Working...
X