Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bools and NinjaTrader Internal Logic

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

    Bools and NinjaTrader Internal Logic

    In programing I like to create bools to consolidate code, but I am concerned about doing this with NinjaTrader Internal Logic. I do not want to compromise the integrity of my strategy. Can you please tell me if the following code would have adverse reactions to a strategy.
    Thanks
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]
    [COLOR=black][COLOR=blue]private bool[/COLOR] Long {get { return Position.MarketPosition == MarketPosition.Long; } }[/COLOR]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][COLOR=black][/COLOR]

    or
    Code:
    [FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]
    [COLOR=black][COLOR=blue]private bool[/COLOR] Long1 {get { return Position1 == MarketPosition.Long; } }[/COLOR]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT]

    #2
    Hello kenb2004,
    NinjaTrader is basically C# and will use any standard C# logics/features.

    You can simply write a function. A sample code will be like

    Code:
    private bool Long()
    {
     return Position.MarketPosition == MarketPosition.Long;
    }
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by 00nevest, Today, 02:27 PM
    0 responses
    0 views
    0 likes
    Last Post 00nevest  
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    9 views
    0 likes
    Last Post futtrader  
    Working...
    X