good night
Help me please to finish an indicator code, because after all programmed, when the information appears in the graphic appears the values thus 0.12345678, and I want it to be 0.1234 or 0.12, what encoding should I put? and where you want?
It would be possible to prepare the encoding for the user to select if 0.1234 or 0.12?
thanks for help
Please check https://docs.mql4.com/convert/DoubleToStr
but where you put this text in order to take effect ?
sextaefira - you've been given a good answer by brother3th.
You need to do a little work yourself. Sounds like you ought to do a little reading of the mql4 documentation.
If you'd bothered to do that, you wouldn't need to ask the question you just asked.
"Help me please to finish an indicator code, because after all programmed" - You tell us you can drive a car.
"0.12345678, and I want it to be 0.1234 or 0.12" - You ask for specific directions.
"Please check https://docs.mql4.com/convert/DoubleToStr" - You are given correct directions.
"but where you put this text in order to take effect ? and how to put the function extern int, so that you can select 0.0000 or 0.00" - Now you ask "how do I get in the car and where do I sit".
Start here:
https://book.mql4.com/basics/index
Hope this helps.
CB
If there's someone who can help me, thank
If there's someone who can help me, thank
// the value is "1.28473"
//---- input parameters
extern int ExtParam1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
int counted_bars=IndicatorCounted();
//----
ObjectCreate("buy", OBJ_LABEL, 0, 0, 0);
ObjectSet("buy", OBJPROP_XDISTANCE, 350);
ObjectSet("buy", OBJPROP_YDISTANCE, 20);
ObjectSetText("buy", "BUY : " + ld_1, 11, "Times New Roman", Lime);
//----
return(0);
}
//+------
//ObjectSetText("buy", "BUY : " + ld_1, 11, "Times New Roman", Lime); ObjectSetText("buy", "BUY : " + DoubleToStr(ld_1,Digits), 11, "Times New Roman", Lime);
is OK : )
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Help me please to finish an indicator code, because after all programmed, when the information appears in the graphic appears the values thus 0.12345678, and I want it to be 0.1234 or 0.12, what encoding should I put? and where you want?
It would be possible to prepare the encoding for the user to select if 0.1234 or 0.12?
thanks for help