How to make custom ENUM constant ENUM_REFERENCE_PRICES?
-
Hi Guys,
I would like to make a custom ENUM constant named ENUM_REFERENCE_PRICES and it should contain 3 elements:
- STARTING_PRICE
- CURRENT_PRICE
- MOVING_AVERAGE
And all 3 should be contained in one combo box or drop down list in EA inputs (like timeframes), so the trader can choose what price will be the reference price in trading.
Very important:
- If "Starting price" selected in EA inputs: value should be set when EA starts (on Init).
- If "Current price" selected in EA inputs: value should be set every Tick.
- If "Moving Average" selected in EA inputs: value should be set from existing project constant "Moving Average" which, also, trader can enter period (14 or 20 or 200) in EA inputs.
Idea is that the EA decides which position to open (buy or sell) regarding to which chosen price is currently above or below.
So, if trader choose "Starting price" all above that price will be buy and below sell.
Next, if trader choose "Moving Average" all above MA will be buy and below sell.
I hope that I explained well
P.S.
Please detailed explanation because I'm beginnerThank in advance
-
@prot82 I looked at this the other day, is defiantly possible but am unsure how to use this code in a custom code block on FX.
-
To make it simple, I just want to have implementation like in picture. Trader can choose 1 of 3 options and I would like to deal it like 3 cases

-
@prot82 If you want to use a pre defined function like timeframe, this is simple, type = ENNUM_TIMEFRAMES, a personal one I don't know.