Mohammad Rizal Bin Rahmat:
Need a little help.
So i'm trying to create an indicator. but i have a problem.
i have tried to google for answer but can't find it.
hope someone here does know.
i use the GVGet and GVSet function so will get a better picture
I'm trying to code the above rules into indicator.
tried google for answer but can't find it.
Thank you for helping
Need a little help.
So i'm trying to create an indicator. but i have a problem.
i have tried to google for answer but can't find it.
hope someone here does know.
i use the GVGet and GVSet function so will get a better picture
I'm trying to code the above rules into indicator.
tried google for answer but can't find it.
Thank you for helping
- Help you with what? You haven't stated a problem. Show us your attempt
(using SRC) and state the nature of
your problem.
No free help
urgent help.
Help you with what? You haven't stated a problem.
Find what?
Knows what?
Unknown functions. There are no mind readers here and our crystal balls are cracked.
No rules stated.
Find what?
Help you with what? You haven't stated a problem. -
Why did you post your MT4 question in the
Root /
MT5 Indicators section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Are your books one column but two feet wide? No because that is unreadable. They
are 6 inches, sometimes two columns, so you can read it easily. So should be
your code. I'm not going to go scrolling (or moving my eyes) back and forth
trying to read it. Don't copy and paste code, write self-documenting code:
double H1open = iOpen(NULL,PERIOD_H1,0); double H1EMA = iMA(NULL,PERIOD_H1,50,0,MODE_EMA,PRICE_CLOSE,0); double H1close = iClose(NULL,PERIOD_H1,0); bool isH1crossUp = H1open<H1EMA && H1close>H1EMA; bool isH1crossDn = H1open>H1EMA && H1close<H1EMA; (isH1crossUp) {GVSet("buy",1);} (isH1crossDn) {GVSet("sell",1);} (isH1crossUp) {GVSet("sell",0);} (isH1crossDn) {GVSet("buy",0);} //than i will have my code as below for the indicator double M15open = iOpen(NULL,PERIOD_M15,0); double M15EMA = iMA(NULL,PERIOD_M15,50,0,MODE_EMA,PRICE_CLOSE,0); double M15close = iClose(NULL,PERIOD_M15,0); bool isM15CrossUp = M15open<M15EMA && M15close>M15EMA; bool isM15CrossDn = M15open>M15EMA && M15close<M15EMA; if(GVGet("buy")==1 && isM15CrossUp) // then i will have my indicator arrow or so on if(GVGet("sell")==1 && isM15CrossDn) // then i will have my indicator arrow or so on
- Those GVSet lines do not compile. Don't post code that doesn't compile. You know what an if statement is.
- Why do you want to sell when the H1 closes above the EMA or below the EMA? Makes no sense.
- Those if lines do not compile, where is your code that draws the arrows. Don't post code that doesn't compile or indicate that you have purposely left out ...
- What is the purpose of the GVs? Why not just use Booleans?
if(isH1crossUp && isM15crossUp) // then i will have my indicator arrow or so on
-
On MT4: Unless the current chart is the specific pair/TF referenced, you must handle
4066/4073 errors.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum - You are looking at bar zero. You will get intermittent signals as price fluctuates around the EMA. Perhaps you want to use the closed candle.

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
Hey guys,
Need a little help. Still learning on coding.
So i'm trying to create an indicator. but i have a problem. i have tried to google for answer but can't find it. hope someone here does know. i use the GVGet and GVSet function so will get a better picture
I'm trying to code the above rules into indicator. tried google for answer but can't find it. Thank you for helping