The variable name is a constant. The name of the variable is unchanged.
I found a clear use case example:
$Reno = 360000;
$Pasadena = 138000;
$cityname = "Reno";
echo "The size of $cityname is ${$cityname}";
$cityname = "Pasadena";
echo "The size of $cityname is ${$cityname}";
//The output fromthis code is
//The size of Reno is360000
//The size of Pasadena is138000
I would like to modify this Fractal indicator that I attached so that I could modify the number of bars on side that has by default, this indicator that has the code open and can be modified, the number that I would like is 15/15, thanks
I would like to modify this Fractal indicator that I attached so that I could modify the number of bars on side that has by default, this indicator that has the code open and can be modified, the number that I would like is 15/15, thanks
Sorry, only MQL5 is discussed here. All questions on the old code you can solve in the service Freelance.
voidOnStart()
{
//--- trade server namestring server=AccountInfoString(ACCOUNT_SERVER);
//--- account numberint login=(int)AccountInfoInteger(ACCOUNT_LOGIN);
//--- long value outputlong leverage=AccountInfoInteger(ACCOUNT_LEVERAGE);
PrintFormat("%s %d: leverage = 1:%I64d",
server,login,leverage);
//--- account currencystring currency=AccountInfoString(ACCOUNT_CURRENCY);
//--- double value output with 2 digits after the decimal pointdouble equity=AccountInfoDouble(ACCOUNT_EQUITY);
PrintFormat("%s %d: account equity = %.2f %s",
server,login,equity,currency);
//--- double value output with mandatory output of the +/- signdouble profit=AccountInfoDouble(ACCOUNT_PROFIT);
PrintFormat("%s %d: current result for open positions = %+.2f %s",
server,login,profit,currency);
//--- double value output with variable number of digits after the decimal pointdouble point_value=SymbolInfoDouble(_Symbol,SYMBOL_POINT);
string format_string=StringFormat("%%s: point value = %%.%df",_Digits);
PrintFormat(format_string,_Symbol,point_value);
//--- int value outputint spread=(int)SymbolInfoInteger(_Symbol,SYMBOL_SPREAD);
PrintFormat("%s: current spread in points = %d ",
_Symbol,spread);
//--- double value output in the scientific (floating point) format with 17 meaningful digits after the decimal pointPrintFormat("DBL_MAX = %.17e",DBL_MAX);
//--- double value output in the scientific (floating point) format with 17 meaningful digits after the decimal pointPrintFormat("EMPTY_VALUE = %.17e",EMPTY_VALUE);
//--- output using PrintFormat() with default accuracyPrintFormat("PrintFormat(EMPTY_VALUE) = %e",EMPTY_VALUE);
//--- simple output using Print()Print("Print(EMPTY_VALUE) = ",EMPTY_VALUE);
/* execution result
MetaQuotes-Demo 1889998: leverage = 1:100
MetaQuotes-Demo 1889998: account equity = 22139.86 USD
MetaQuotes-Demo 1889998: current result for open positions = +174.00 USD
EURUSD: point value = 0.00001
EURUSD: current spread in points = 12
DBL_MAX = 1.79769313486231570e+308
EMPTY_VALUE = 1.79769313486231570e+308
PrintFormat(EMPTY_VALUE) = 1.797693e+308
Print(EMPTY_VALUE) = 1.797693134862316e+308
*/
}
hey, no the point of using dynamic variables is, that i want call a list of classes and store them in a array. Now i use a construct of if conditions with hard coded class names. but i would be fancy to have a array of classnames and than call them such as:
this is a very simple example without a loop and without a base class ( class interface )
i use this in perl to load modules for example. but i had this discussion in another thread and i guess it's not posible because the var names are static.
hey, no the point of using dynamic variables is, that i want call a list of classes and store them in a array. Now i use a construct of if conditions with hard coded class names. but i would be fancy to have a array of classnames and than call them such as:
this is a very simple example without a loop and without a base class ( class interface )
i use this in perl to load modules for example. but i had this discussion in another thread and i guess it's not posiblebecause the var names are static.
The variable name is a constant. The name of the variable is unchanged.
I found a clear use case example:
Will be my last attempt at explaining myself ;)
And why do we need such an indicator? What is the idea of using it?
so we can know how we perform on the current day, either win or lose on trading.
that's big effect on trader emotion.
so we can know how we perform on the current day, either win or lose on trading.
that's big effect on trader emotion.
Where is the trading idea? What gives knowledge: today we are in profit or loss? How should this affect the trade of an adviser?
I would like to modify this Fractal indicator that I attached so that I could modify the number of bars on side that has by default, this indicator that has the code open and can be modified, the number that I would like is 15/15, thanks
I would like to modify this Fractal indicator that I attached so that I could modify the number of bars on side that has by default, this indicator that has the code open and can be modified, the number that I would like is 15/15, thanks
Sorry, only MQL5 is discussed here. All questions on the old code you can solve in the service Freelance.
huuh ...does i read correct -> this works in MT5 ?
echo "The size of $cityname is ${$cityname}";if yes it would be amazing ....mmmmh more complex programming ...i could eat that language
äähhmm i had a idea ... a nice c++ "try & catch" function would be a great feature :D
huuh ...does i read correct -> this works in MT5 ?
if yes it would be amazing ....mmmmh more complex programming ...i could eat that language
See the examples: PrintFormat
See the examples: PrintFormat
hey, no the point of using dynamic variables is, that i want call a list of classes and store them in a array. Now i use a construct of if conditions with hard coded class names. but i would be fancy to have a array of classnames and than call them such as:
this is a very simple example without a loop and without a base class ( class interface )
i use this in perl to load modules for example. but i had this discussion in another thread and i guess it's not posible because the var names are static.
hey, no the point of using dynamic variables is, that i want call a list of classes and store them in a array. Now i use a construct of if conditions with hard coded class names. but i would be fancy to have a array of classnames and than call them such as:
this is a very simple example without a loop and without a base class ( class interface )
i use this in perl to load modules for example. but i had this discussion in another thread and i guess it's not posible because the var names are static.
That's right, in MQL5 the var names are static.