So i’ve been learining mql4 for a while now and i’m working on an EA for my strategy and have run into a few issues pertaining to know-how.
issue 1
-
An EA doesn’t need to draw an indicator on the chart for it to take trades based on said indicator.
So if i put an external input for my settings of an RSI, then put #define rsi = iRSI(), everytime i put rsi it will return the value of the rsi indicator in place of rsi everytime i put it in my code right? -
In that case, how can i actually incorporate the RSI indicator to be actually drawn on my chart? I’ve looked act ObjectCreate, but it’s not making sense to me to how i can actually have it drawn on my chart and in a separate window. is ObjectCreate the actual function i’m looking for?
issue 2
- I’m working on a strategy that checks for certain conditions to be met before taking a trade.
The condition would be like this in the ontick section:
if ma1 is above ma2, then check to look for rsi to be oversold.
if so buy, if not, return()
Else ma1 is below ma2, check for rsi to be overbought.
if so, sell. if not, return()
then it would loop checking for ma1 to be above or below ma2 with the corresponding rsi check.
- How do i set it up so that the loop will check over and over again? i’m not understanding the whole loop coding.
issue 3.
-
Since i don’t need to actually draw the indicators on the chart, i don’t really need anything in the OnInit or OnDeinit do it?
-
If i wanted to draw the indicators on the chart, then I would just have them place in the ontick function before the conditional checks for my trades right? cause the indicators would have to recalculate everytime there is a new price change?
Please comment, i’m really determined and I’m trying to understand the way the coding needs to be layed out for an indicator to work.
Cheers,
AK