Simple question - How to access input parameters?
-
Just before my buy / sell order is sent I want to check the condition of an input parameter before continuing. I have entry conditions that are set in the inputs page of the EA. In addition I have a condition for an "emergency exit" which is simply a condition block that compares two indicators (MAs). Just before my buy / sell executes I need to check the condition of my emergency exit block before execution. As an example what I need to check for, say a sell, is if inp15_Lo_MAperiod > inp15_Ro_MAperiod then (abort sell order). What I can't figure out is how to access the inp15_Lo_MAperiod and inp15_Ro_MAperiod input parameters???
This seems like it should be simple but I can't seem to figure it out

Thanks for any help
-
I don't really recommend to use those checkboxes. They are good if you want to do optimization, otherwise not. I will suggest to use "Constants"

But I don't understand why you want to check these input parameters, because you are the one who decide what their values will be.
-
Don't think I can use constants because these parameters (inp15_Lo_MAperiod and inp15_Ro_MAperiod) are set by the user so I have no way of knowing what they might be before the EA is running. So I need to check their values during runtime.
I can't figure out how to use variables because I can't figure out how to assign the values from the inputs (or how to check the inputs).
Here is a sample logic if it will help.
Entry conditions (here for a sell):
main_trend--> if ema 5 < ema 8
secondary condition--> if ema 8 < ema 13
final entry condition--> if ema 13 < ema 62(Here I need--> if ema 62 < ema 100 then go ahead and open the trade, but the ema values are set as input parameters which may be something other than 62 and 100, that's what I need to check is what those input parameters are)
Sell Now
But I have an "emergency exit" check, once in a trade, that is--> if ema 62 > ema 100 then exit (short) trade.
What is happening is my entry conditions are met and the trade is opened but the emergency exit conditions are also met so the trade closes immediately (costing me the spread each time).
So, just before my sell order executes I need to make sure my emergency exit condition (set in inputs) is in a state to allow the trade to open.
Make sense?
-
You can check these anyway. In Condition go to Value - Numeric (Text, Boolean), right click on the input field and choose a Constant.
-
Ok thanks for the help.
I just added an additional condition check before the entry and that is giving me the results I wanted.
So it's pretty much just a quadruple MA cross trading robot
