Menu
Brokers
MT4 Forex Brokers
MT5 Forex brokers
PayPal Brokers
Skrill Brokers
Oil Trading Brokers
Gold Trading Brokers
Web Browser Platform
Brokers with CFD Trading
ECN Brokers
Bitcoin FX Brokers
PAMM Forex Brokers
With Cent Accounts
With High Leverage
Cryptocurrency Brokers
Forums
All threads
New threads
New posts
Trending
Search forums
What's new
New threads
New posts
Latest activity
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Reply to thread
Forums
Trading Platforms
MetaTrader 5
indicator colour
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
[QUOTE="samjesse, post: 22055, member: 11960"] when I use the following line, it plots the indicator in Red only. [code=mql5]#property indicator_type1 DRAW_LINE[/code] When I use the following line, it does not plot it at all. [code=mql5]#property indicator_type1 DRAW_COLOR_LINE[/code] here are the relevant sections of the code: [code=mql5] #property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 1 #property indicator_type1 DRAW_COLOR_LINE #property indicator_style1 STYLE_SOLID #property indicator_color1 clrRed, clrBlue // Indicator buffers double itemp[300]; double iBuf[]; double iBuf_colour[]; int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,iBuf,INDICATOR_DATA); SetIndexBuffer(1, iBuf_colour,INDICATOR_COLOR_INDEX); PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE); ArraySetAsSeries(iBuf, true); int OnCalculate(const int rates_total,... for(int x = 0; x < ArraySize(itemp); x++) { iBuf[x] = itemp[x]; if(x<6) iBuf_colour[x]=1; else iBuf_colour[x]=0; //Alert(x + " colour is " + iBuf_colour[x]); <<<< all is well } return (rates_total); } [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Top
Bottom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…