Convergence of different conditions – EA Wizard
1 year ago #269131
How can I code a rule that triggers a buy/sell signal multiple conditions?
For example, I want to go long when close>EMA(20), rsi >30 and CCI>0. I don’t know in which order the 3 conditions will happens, I want that every time 3 conditions happens(for the first time) it will triggers signal. I ask for EA wizard because I need custom indicators.
I hope my request is clear.
do you mean these conditions must be valid for the same bar / candle (at the same time)?
1 year ago #269159
I try to explain better:
if I have only 2 conditions it’d be easy: ema20>ema50 and cci crosses over 0 OR cci>0 and ema20 crosses above ema50.
But what if I have 3 or more conditions? I am not looking for all 3 happening at the same candle, I want the FIRST TIME the 3 conditions happen.
For example firt we have the cross of ema20 above ema50, then 2 candle after cci goes over 0 and some candle after rsi goes above 30.
I am no expert in mql coding, but in easylanguage or prorealcode I would assign 1 to each positive condition, and their sum would be assigned a variable, f.e. buycond.
Buycond=3 when all conditions are met. If buycond=3 and buycond<3 (previous candle, so this is first time all conds are met) it will trigger order.
I hope it is more clear now.
yes, you are right. You can do it the same way in AlgoWizard. Setup 2 different tabs describing first 2 conditions and assign cond1 = 1 if the condition 1 is valid and cond2 = 1 if the condition 2 is valid
Finally setup a tab for the 3rd condition. If its valid AND cond1 + cond2 = 2 you can execute a trade and set cond1 & cond2 to 0 (zero)
1 year ago #269292
Could you make an example in EA Wizard please?
I fear I didn’t undertand well.
Sure, do you work in the older EA Wizard or AlgoWizard? (the new version)
1 year ago #269307
Older please, I need a custom indicator to use.
You can check the example attached
Viewing 8 posts - 1 through 8 (of 8 total)