INIT
-
Hiho,
i have a massive problem in programming the INIT function. I use a variable 'CurrentBar' which i count from a given number down to 1 to draw some objects on specific circumstances. The function doesn't return and count the variable down till a stack overflow error. Can you post a simple example on how to draw some objecs in the INIT function and/or explain how to exit the INIT?
thx in advance
-
EA builders are good to quickly add/remove things like Buy, Sell, Close and similar. When it comes to variables manipulation you are searching for troubles with every new block that is visually bigger than the variable itself

Now you have a big net of blocks that do very simple things, and in that case it will be better to write all this in MQL4 code
-
And by the way, I think you want to create an indicator. Maybe the right choise is to really do that. Fxdreema can't help much, but at least I think it's funny (that's why there are many indicators around).
Init can't be escaped because each block is enclosed in a different function, and with putting "return;" in a block you actually escape the function created for this block, but not the main "init()" function.
-
Thanks for the replys. It will be no indicator but the EA should also show you what the EA will see within the price action and why it took a trade. So i draw some rectangles to show what also had been in the past.
I already removed the return statement
. That was pure nonsense from my side.At the moment i try to use some MQL block to shrink the number of blocks. But what i like to see is to shrink the opened MQL-code box more than it is possible at the moment.
The overview of the EA is nat that good and a block with a short label can't express what i do in it...Hope i will get around the error i see at the moment and why the CurrentBar value can go under 0 when there is block to catch it and it why it will be executed till error...
