So I come up with this:
// global extern string SELECT_maBIAS_ONINIT; extern string MA_High_Bias; extern datetime D1_Bar_OnInit; extern string MA_Middle_Bias; extern datetime H4_Bar_OnInit; extern string MA_Low_Bias; extern datetime H1_Bar_OnInit; ... int OnInit() { D1_Bias = MA_High_Bias; H4_Bias = MA_Middle_Bias; H1_Bias = MA_Low_Bias; D1_Bar = D1_Bar_OnInit; H4_Bar = H4_Bar_OnInit; triggerBarTime = H1_Bar_OnInit; ...
Now because I am using extern string and datetime that correspond with strings and datetimes in EA, whenever the EA wants to change variables like D1_Bias or H4_Bias or D1_Bar, the extern will just override it even though those externs are no where else to be found other than OnInit()?
I ONLY want to use these extern variables all the while the EA finds a new replacement value for them... then I want to discard these extern variables for good?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am wanting to have a drop-down box on the parameter window of my EA that correspond to a string variable within OnInit()
I could just use extern string and type in the exact wordings that correspond to the given function within my EA, but i'd rather have a drop down box to make 100% sure that I have not made a mistake. This is so that when I first drop my EA onto the chart I can provide it's bias accurately OnInit() and then once a new bar comes in, it'll take over and change bias if applicable.
Any ideas how I can assign an extern enum to a string?
ALSO: In alignment with these strings OnInit() that I am trying to work out above, I also want to be able to specify a specific "datetime" myself and assign it to example datetime variable above: "D1_Bar" (second code window - notes attached within it)