Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

three conditions in one Line of code

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

    three conditions in one Line of code

    trying to include all three bars in one code as opposed to three separate lines of code
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]([/FONT][/SIZE]
    [SIZE=2][FONT=Courier New](ToTime(Time[[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) > (start_trading) && ToTime(Time[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]) < (stop_trading)) [/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]&& Bar_Green_Bool_Test_v1([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]2.618[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]18[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]).Green_Bar[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] == [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]&& Bar_Green_Bool_Test_v1([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2.618[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]18[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]).Green_Bar[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] == [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2]&& Bar_Green_Bool_Test_v1([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2.618[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]18[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]).Green_Bar[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] == [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT]

    #2
    Hi duck_CA, you could do this with a loop in NinjaScript - http://www.ninjatrader-support.com/H...gCommands.html
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Austiner87, Yesterday, 03:42 PM
    2 responses
    23 views
    0 likes
    Last Post Austiner87  
    Started by mlprice12, 12-21-2021, 04:55 PM
    4 responses
    303 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Mathias79, Yesterday, 03:44 PM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Board game geek, Today, 01:34 AM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by cencored, 03-31-2016, 05:09 PM
    9 responses
    2,455 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X