Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Public Variables?!! Please Help... going mad!!

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

    Public Variables?!! Please Help... going mad!!

    Hi,

    Someone please shed some light on this seemingly simple subject for me.

    I have been programming in MQL4 for a while and understand it well... so the migration to Ninja is quite easy so far....... except for one thing.

    In , MQL4 if you want a user defined vaiable all you do is put an "extern" infrom of your variable.... then its done.

    The "extern" seems to be replaced to "public" in ninja... but when i put public in front it doesnt show up as definable when backtesting the strategy......

    So in looking at a few codes i find this works

    [Description("")]
    [Category("Parameters")]
    public bool JustEntered
    {
    get { return justEntered; }
    set { justEntered = value; }
    }

    Is that much code really needed to do the same thing as this "extern bool JustEntered"?

    Could it be that complex or am i missing something........ can someone please explain what all the "get" and "set" stuff is.

    any help great appreciated.... thanks in advance.

    #2
    Marty, I would not be aware how MT4 would handle this area, but your code is correct, basically you would need to check into the contents of this tip for creating user defined inputs - http://www.ninjatrader.com/support/f...ead.php?t=5782

    You create a public property for the private variable, so those would 'linked'.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    60 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X