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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    646 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    570 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X