hi experts
i'm trying to develop a custom indicator but at this stage it's getting very heavy and mostly cause the mt4 frozen
i wonder there is some general instruction for for optimizing the code so or even a tool to show which part of the code cause the frozen problem
The best solution is to switch to MT5.
i wonder there is some general instruction for for optimizing the code so or even a tool to show which part of the code cause the frozen problem
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. - If it is freezing MT4, that means you are not returning. You do not optimize that, you fix your broken indicator.
- Yes, there is a tool. It's call the profiler; built in to the editor.
- Once you start getting messages about the indicator taking too long, then, as a last resort, use my segmented OnCalculate include file.
Your indicator is too slow... - Indices - MQL4 programming forum #1 № 6
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. - If it is freezing MT4, that means you are not returning. You do not optimize that, you fix your broken indicator.
- Yes, there is a tool. It's call the profiler; built in to the editor.
- Once you start getting messages about the indicator taking too long, then, as a last resort, use my segmented OnCalculate include file.
Your indicator is too slow... - Indices - MQL4 programming forum #1 № 6
sorry for my mistake
your answer was helpful
apparently this section of my code for deleting object that called by multi time is problem:
void MegaDelete(int shift) { int j=Time[shift]; for(int i=ObjectsTotal(0,-1,-1); i>=0; i--) { if(StringFind(ObjectName(i), IntegerToString(j))==11&& StringFind(ObjectName(i), RSILine)!=-1) { ObjectDelete(0,ObjectName(i)); } if(StringFind(ObjectName(i), IntegerToString(j))==13&& StringFind(ObjectName(i), PriceLine)!=-1) { ObjectDelete(0,ObjectName(i)); } }
this code give a int and compare all object to find a object with certain character in there (and their places in the names)
there is better way to write it ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi experts
i'm trying to develop a custom indicator but at this stage it's getting very heavy and mostly cause the mt4 frozen
i wonder there is some general instruction for for optimizing the code so or even a tool to show which part of the code cause the frozen problem