This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community
set arrow functionBack to topics list |
|
bbzz24
2005.07.18 04:14
hello,
I am stuck in my attempts to set on the charts symbols instead of execute orders while backtesting. Can someone help with a code snippet that is supposed to draw thumbs up for example when a condition is met? When I replace SetOrder(OP_SELLLIMIT,Lots,v1,3,v1+StopLoss*Point,v1-TakeProfit*Point,RED); with SetArrow(10, High, 241, Red); I do not get any result. For your info I am using MT3. |
|
Vooch
2005.07.18 18:37
I don't think it's possible to write an arrow on the chart using just an Expert Advisor. I wish it could.
- Vooch |
|
Rosh
2005.07.18 23:04
For example
void SetArrow(datetime ArrowTime, double Price, double ArrowCode, color ArrowCollor)
{
int err;
string ArrowName = DoubleToStr(ArrowTime,0);
if (ObjectFind(ArrowName) != -1) ObjectDelete(ArrowName);
if(!ObjectCreate(ArrowName, OBJ_ARROW, 0, ArrowTime, Price))
{
err=GetLastError();
Print("error: can't create Arrow! code #",err," ",ErrorDescription(err));
return;
}
else
{
ObjectSet(ArrowName, OBJPROP_ARROWCODE, ArrowCode);
ObjectSet(ArrowName, OBJPROP_COLOR , ArrowCollor);
ObjectSet(ArrowName, OBJPROP_WIDTH , ArrowSize);
ObjectsRedraw();
}
} |
|
Vooch
2005.07.20 02:10
Rosh (or anyone),
Is there a way to get the Wingding symbols to work with that script? Thanks, Vooch |
|
Vooch
2005.07.20 02:30
i got it working. thanks!
|
|
Vooch
2005.07.20 04:19
Put your emotions on the chart, not in the trade...
You make a 100 pip profit and ring the register... SetArrow(Time[0],Ask,37,Green); // Bell You make a profit... SetArrow(Time[0],Ask,74,Green); // Smiley Face You make a 5-pip profit... SetArrow(Time[0],Ask,73,Green); // High-Five Hand Your defensive trailing stop takes you out... SetArrow(Time[0],Ask,66,Green); // Missile Your take a small loss... SetArrow(Time[0],Ask,75,Red); // Angry Face You get stopped out... SetArrow(Time[0],Ask,79,Red); // Surrender Flag Your ready to jump out the window... SetArrow(Time[0],Ask,255,Yellow); // Windows Your 10 pip trade turns into a 200 pip loss... SetArrow(Time[0],Ask,77,Yellow); // Bomb Your account goes down to zero from a misguided autotrade... SetArrow(Time[0],Ask,78,Gray); // Skull & Crossbone LOL, Vooch |
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets
