frobber:
MA1 = iMA (NULL, PERIOD_CURRENT, 21, 0, MODE_EMA, PRICE_CLOSE, 0); |
|
//void Draw_up(int Code,int Fontsize,color LineColor, string Anchorpunkt) void Draw_up( int Code, int Fontsize, color LineColor, double Anchorpunkt) //void Draw_down(int Code,int Fontsize,color LineColor, string Anchorpunkt) void Draw_down( int Code, int Fontsize, color LineColor, double Anchorpunkt)
These are evident mistakes.
In either case, I think that it is much easier to prepare buffers to use "SetIndexArrow" than create objects.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hello
I am lost - maybe some gurus can help me ;)
My goal is to draw colored arrow in the chart exactly at the EMA line - but only when the difference from current to previous candle is above/below a specific level.
So far so good ...
During an Uptrend - the arrow is displayed exactly on the EMA line in the chart and works as expected.
But on a downtrend the arrows are always drawn a bit below the EMA line... and I have no clue why !
example code:
MA1 = iMA (NULL, PERIOD_CURRENT, 21, 0, MODE_EMA, PRICE_CLOSE, 0);
example code for drawing function:
void Draw_up(int Code,int Fontsize,color LineColor, string Anchorpunkt)
{
string objName = "up" + Time[1];
ObjectCreate(objName, OBJ_TEXT, 0, Time[1], Anchorpunkt);
ObjectSetText(objName, CharToStr(Code), Fontsize, "Wingdings", LineColor);
}
void Draw_down(int Code,int Fontsize,color LineColor, string Anchorpunkt)
{
string objName = "down" + Time[1];
ObjectCreate(objName, OBJ_TEXT, 0, Time[1], Anchorpunkt);
ObjectSetText(objName, CharToStr(Code), Fontsize, "Wingdings", LineColor);
}
I call the functions:
Draw_up(230,16,MediumBlue,MA1);
Draw_down(228,16,MediumBlue,MA1);
I tried to change the MA line in the chart from Close to all available price options but I couldnt find the settings to match my downtrend symbols ....
Any idea?