Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 896
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
there is a constant in the OPENCL cl_ inline and it is equal to #define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 by double-checking the degree of two in 1024 got. 2^1024 = 179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216 And then below that is the number of pi
after
#define CL_M_PI 3.141592653589893115998
3.141592653589793238462643383279502884197169
explain why ????
https://ru.wikipedia.org/wiki/Число_двойной_точности
I have added these event handlers for operation and update of the panel:
- OnChartEvent for handling button clicks
- OnTimer for panel data update
The whole code is 750+ lines, there are only several loops, one for updates in the indicator window, the other three have a small number of passes (max 10 * 4)
This part of code after OnChartEvent if(id == CHARTEVENT_OBJECT_CLICK) is noticeably slow
My indicator has a delay of +/- 1 second after the button is pressed. MQL5
I have added these event handlers for operation and update of the panel:
- OnChartEvent for handling button clicks
- OnTimer for panel data update
The whole code is 750+ lines, there are only several loops, one for updates in the indicator window, the other three have a small number of passes (maximum 10 * 4)
This part of code after OnChartEvent if(id == CHARTEVENT_OBJECT_CLICK) is noticeably slow
ChartRedraw() is needed after all changes have been made to all objects whose properties are changed by the button action.
ChartRedraw() is needed after making all changes in all objects whose properties are changed with button action.
Indeed! I hadn't thought of that. Thank you very much!
I was putting alerts inOnChartEvent if(id ==CHARTEVENT_OBJECT_CLICK) - there were alerts, no updates. And that's why I couldn't understand why
Is it possible to get the balance value on previous bars in mcl4? How do I write it in the code?
Hello, experts! Doesn't anyone know?! I don't believe it.
Hello, experts! Doesn't anyone know?! I don't believe it.
Here is the price of one tick
SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE ) * volume
Then multiply by the difference in ticks between the order open price and the Close (or other) price of the needed bar. But take into account that you cannot know using the standard methods what the spread was at that moment in time
Hello, experts! Doesn't anyone know?! I don't believe it.
the balance depends on the closing of positions - if nothing was closed, then the balance did not change
I must not have phrased the question correctly, since the answers are off-topic. I don't care if the positions have closed or not, and I'm not interested in the cost of the tick. I need to know what the account balance was at the time of closing 1, 2, 3 bars for comparison. Positions were opened and closed on these bars, and therefore the balance was changing. We need to know the specific value. Thank you.
- We look at the time of the last bar
- add up everything that was closed on this bar
- subtract from the current balance
and so all the bars in turn