Hi i try set color for create indicator but not set color
{
MqlParam params[];
int handle;
ArrayResize(params,5);
//--- set ma_period
params[0].type =TYPE_INT;
params[0].integer_value=20;
//--- set ma_shift
params[1].type =TYPE_INT;
params[1].integer_value=0;
//--- set ma_method
params[2].type =TYPE_INT;
params[2].integer_value=MODE_EMA;
//--- set applied_price
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;
//- I add this index params array for set color to indicator
params[4].type =TYPE_COLOR;
params[4].integer_value=DodgerBlue;
handle = IndicatorCreate( Symbol() , PERIOD_CURRENT , IND_MA , 5 , params );
ChartIndicatorAdd(0,0,handle);
}
Make it as a parameter and then you shall be able to adjust the color too
I did not understand what you mean
how can i ?
Make it as a parameter and then you shall be able to adjust the color too
i try that but still not work
{
color color_value;
};
MqlParams params[];
ArrayResize(params,5);
int handel;
//--- set ma_period
params[0].type =TYPE_INT;
params[0].integer_value=15;
//--- set ma_shift
params[1].type =TYPE_INT;
params[1].integer_value=0;
//--- set ma_method
params[2].type =TYPE_INT;
params[2].integer_value=MODE_EMA;
//--- set applied_price
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;
//--- set color
params[4].type =TYPE_COLOR;
params[4].color_value = RoyalBlue ;
handel = IndicatorCreate( Symbol() , PERIOD_CURRENT , IND_MA , 5 , params );
ChartIndicatorAdd(0,0,handel);
what is my wrong ?
The colors are not indicator parameters. You need to change the indicator's code and add colors as parameters to do what you want.
Which is not possible with MA by the way, so you will have to create a custom MA (or modify an existing one with available source code).
The colors are not indicator parameters. You need to change the indicator's code and add colors as parameters to do what you want.
Which is not possible with MA by the way, so you will have to create a custom MA (or modify an existing one with available source code).
Hi Alian
I dont want change source cod .
I maked a button and i want add indicator on chart (with specified color and specified STYLE line) when i press the button
i have 2 way :
1 - use changed cod
2 - use default indicator
Now i want us default indicator with iCustom or IndicatorCreate or iMA
you say i can not set the color and line style by IndicatorCreate
Can i set line color and line style by iCustom or iMA ???
If i can ? How set color and line style ?
Please give me a sample if you can
Tank you
The colors are not indicator parameters. You need to change the indicator's code and add colors as parameters to do what you want.
Which is not possible with MA by the way, so you will have to create a custom MA (or modify an existing one with available source code).
I try this but not work
ChartIndicatorAdd(0,0,AddRem_MA_Handle);
Hi Alian
I dont want change source cod .
My firstname is Alain and not Alian.
And i cant do that with iMA ?
No
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi i try set color for create indicator but not set color
{
MqlParam params[];
int handle;
ArrayResize(params,5);
//--- set ma_period
params[0].type =TYPE_INT;
params[0].integer_value=20;
//--- set ma_shift
params[1].type =TYPE_INT;
params[1].integer_value=0;
//--- set ma_method
params[2].type =TYPE_INT;
params[2].integer_value=MODE_EMA;
//--- set applied_price
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;
//- I add this index params array for set color to indicator
params[4].type =TYPE_COLOR;
params[4].integer_value=DodgerBlue;
handle = IndicatorCreate( Symbol() , PERIOD_CURRENT , IND_MA , 5 , params );
ChartIndicatorAdd(0,0,handle);
}