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 tsantospinto, 04-12-2024, 07:04 PM
7 responses
126 views
0 likes
Last Post aligator  
Started by futtrader, 04-21-2024, 01:50 AM
5 responses
56 views
0 likes
Last Post NinjaTrader_Eduardo  
Started by PeakTry, Today, 10:49 AM
0 responses
2 views
0 likes
Last Post PeakTry
by PeakTry
 
Started by llanqui, Today, 10:32 AM
0 responses
5 views
0 likes
Last Post llanqui
by llanqui
 
Started by StockTrader88, 03-06-2021, 08:58 AM
45 responses
3,994 views
3 likes
Last Post johntraderuser2  
Working...
X