Instead of using the Horisontal Line standard in MT5.
I'd love to have a, "object" price label right following BID,
But I don't have any experience at all with this.
Thanks guys for the help. I believe this would be a huge improvement in MT5
- Moving Average
- need help adding a label to indicator
- Help With iOpen
Jim Nyberg:
This should be easy enough to code? But I don't have any experience at all with this.
How do you know it would be easy enough, if you don't know how to do it?
Mohamad Zulhairi Baba:
I don't....
How do you know it would be easy enough, if you don't know how to do it?
Yeah, it's pretty easy...
#property indicator_chart_window #include <charts/chart.mqh> #include <chartobjects/chartobjectsarrows.mqh> CChart g_chart; CChartObjectArrowRightPrice g_bid; int OnInit() { g_chart.Attach(); g_chart.ShowLineAsk(false); g_chart.ShowLineBid(false); g_bid.Create(0, "__bid", 0, 0, 0.0); return(INIT_SUCCEEDED); } int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { static double last_price = 0.0; int i = rates_total - 1; double bid = close[i]; g_bid.Time(0, time[i]); g_bid.Price(0, bid); if(bid > last_price) g_bid.Color(clrDodgerBlue); else if(bid < last_price) g_bid.Color(clrRed); last_price = bid; return(rates_total); }
nicholi shen:
Yeah, it's pretty easy...
MUCH LOVE FOR THIS!!!!!!!!!!!!!!!!!!!!!
Thank you
nicholi shen:
Yeah, it's pretty easy...
Any idea why when switching timeframes it closes the chart?
nicholi shen:
Oh.. thanks. I'll have to figure that out then 🤣
Yes, CChart closes the chart when destroyed. If you don't want it to close then you should use the Detach method.
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