I have did the following for my EA. So i'm trying to do for my indicator. it works well for my EA. Maybe by looking at the code below for my EA you will understand better.
if(EXTREMEBUY && GVGet("CHBUY")==1){GVSet("EXTREMEBUY",1);} if(EXTREMESELL && GVGet("CHSELL")==1){GVSet("EXTREMESELL",1);} if(BUYSL || BUYTP){GVSet("EXTREMEBUY",0);} if(SELLSL || SELLTP){GVSet("EXTREMESELL",0);} if(CBUY && GVGet("EXTREMEBUY")==1 && MaxOpenOrders > Orders(8) && CurrBar() && ClosedBar() && MarginCheck(0)) { int Ticket = OrderSend(Symbol(), OP_BUY, Lots(), Ask, Slippage*Pip, 0, 0, EAComment, MagicNumber, 0, clrBlue); err = GetLastError();if(err!=ERR_NO_ERROR){ Print("Error on Order open = ", ErrorDescription(err));} GVSet("buy",0);GVSet("sell",0);if(trigger) { alert(0, "Buy");trigger=false;} }
above is the rules for opening a buy. This what i manage to do for my EA. it's working fine. Thank You
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
First of all would like to appologies that i posted here in MQL5 Indicator instead of MQL4 indicator. For unknown reason i couldn't enter the MQL4. everytime i login, it will refresh and change to MQL5. Hope admin could move this thread to MQL4.
I have posted before but with less details. so here i am posting with details. i will try my best to explain
So basically, above code is working just fine. What i'm trying to do which i couldn't get any answer is as below.
for this part,
i just give a name for each code to roughly understand..
for part of the code,
if(CLOSEh1<MA5Lh1 && CLOSEh1<MA10Lh1 && CLOSEh1<MA20h1 && OPENh1>MA5Lh1 && OPENh1>MA10Lh1 && OPENh1>MA20h1 && HIGHh1<TRENDh1 && LOWh1<TRENDh1) &&
will name it SELLH1
if(CLOSEh1>MA5Hh1 && CLOSEh1>MA10Hh1 && CLOSEh1>MA20h1 && OPENh1<MA5Hh1 && OPENh1<MA10Hh1 && OPENh1<MA20h1 && HIGHh1>TRENDh1 && LOWh1>TRENDh1) &&
will name it BUYH1
will name it SELLM15
CLOSE>MA5H && CLOSE>MA10H && CLOSE>MA20 && OPEN<MA5H && OPEN<MA10H && OPEN<MA20 && HIGH>TREND && LOW>TREND)
----------------------------------------------------------------------
So here's the rules which i'm trying to set
IF SELLH1 appear followed by SELLM15, there will be alert or indications
but if SELLH1 appear followed by BUYH1 appear followed by SELLM15 appear, there won't be alert or indications.
this the rules which i'm trying to set buy can't get the answer. Hope people here could guide me if you don't mind.
Thank You