Is there a way to use defult ENUMs but lock(remove) one or a few of values in input parameters?
I hope you got what I want to say but I give you an exampleI want to make Time frames selectable in parameters window.
But I don't want it to show the Current .
I know that I can make my own enum. No problem with that. so that's not a problem, i'm just curious to know.I just wanted to know if it is possible to use defult ENUM_TIMEFRAMES but removing one or more values.
Thanks Marco vd HeijdenNice to see you again after a long time
You can do so by creating a synthetic ENUM_timeframes as shown below:
then for selecting the preferred timeframe you should use the code below:
extern ENUM_Timeframe selected_Timeframe=Any_timeframe;//Selected Timeframe
Be noted that from thereafter you have to use the above mentioned variable as the timeframes in your code.
Hope it helps.
That would work, but you wouldn't have to hard code the numerical values. You can do something like this:
_PERIOD_H4 = PERIOD_H4,
_PERIOD_D1 = PERIOD_D1,
_PERIOD_W1 = PERIOD_W1,
_PERIOD_MN1 = PERIOD_MN1
I admire your advice and confirm that it would be more suitable to code like what you mentioned.
I appreciate your help, As I mentioned before, The question was to see if there is a way to not write a new enum.
But Thanks for your time.