I am newbie here. Please be gentle.
I want to create one simple arrow (any shape is fine).. on the current candle bar (one on the HIGH and another on its LOW).. I know it could be simple, kindly post MQ4 SAMPLE code. Thanks in advance.
I want to create one simple arrow (any shape is fine).. on the current candle bar (one on the HIGH and another on its LOW).. I know it could be simple, kindly post MQ4 SAMPLE code. Thanks in advance.
Here it is.
int i=0; //Current bar //The value -0.0003 and +0.0005 is vertical alignment offset //Will display Blue arrow up at i bar string upArrow=NewArrow(Time[i], Low[i]-0.0003, Blue); //Will display Red arrow down at i bar string dwArrow=NewArrow(Time[i], High[i]+0.0005, Red); //+------------------------------------------------------------------+ string NewArrow(datetime T1, double P1, color collor) { string N=StringConcatenate("A",collor,"-",TimeToStr(T1)); int AC=SYMBOL_ARROWDOWN; if(collor==Blue) AC=SYMBOL_ARROWUP; ObjectCreate(N, OBJ_ARROW, 0, T1, P1); ObjectSet(N, OBJPROP_ARROWCODE, AC); ObjectSet(N, OBJPROP_COLOR, collor); ObjectSet(N, OBJPROP_WIDTH, 1); ObjectsRedraw(); return(N); }
Hey sub , thanks for the code sample, appreciate it. It looks/reads right. I will post feedback, otherwise.
![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
I want to create one simple arrow (any shape is fine).. on the current candle bar (one on the HIGH and another on its LOW).. I know it could be simple, kindly post MQ4 SAMPLE code. Thanks in advance.