No.
Static values are static.
Just 1 more question, if i put another If condition, the Static value will update if last condition is checked?
I still don't undertstand, mql4 book doesn't explain about this, and i really need to know this, for example:
static double Bid_value_saved_forverer;
{
if (Bid > Close[1])
{ Bid_value_saved_forverer = Bid; } // happen...
if (Bid > Close[1])
{ Bid_value_saved_forverer = Bid;} // happen too
}
If the first condition happen, then next happen too, the static will save only the first one, or the last?
Thanks
I still don't undertstand, mql4 book doesn't explain about this, and i really need to know this, for example:
static double Bid_value_saved_forverer;
{
if (Bid > Close[1])
{ Bid_value_saved_forverer = Bid; } // happen...
if (Bid > Close[1])
{ Bid_value_saved_forverer = Bid;} // happen too
}
If the first condition happen, then next happen too, the static will save only the first one, or the last?
Thanks
The last one.
Thanks a lot
const can only be set once.
If you want to remember it between calls, you can try static const
Or look into Global Variables of the Terminal - https://docs.mql4.com/globals
![Global Variables of the Terminal - MQL4 Reference Global Variables of the Terminal - MQL4 Reference](https://c.mql5.com/36/12/global-variables-of-the-terminal.png)
- docs.mql4.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
{
if (Bid > Close [+1])
{ (Bid value saved forverer) } // How can i save Bid value that specific time?