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
It all depends on the logic of the custom indicator. In principle, it can recalculate its values once a day, skipping all other ticks. According to the author's will, so to speak.
Basically, some people try to use this monster approach: create a copy of the indicator via iCustom, copy the necessary data, delete the copy of the indicator. The procedure is repeated as needed.
There is also the function OnTimer(). I haven't worked with it myself, but maybe you can adapt it to your task.
Thank you. I thought so. The OnTimer is not suitable.
There is a situation when the indicator is on M5 but it is called once an hour, for example. It turns out that the indicator will be calculated in the Expert Advisor in idle every 5 minutes for the sake of calling it once an hour. That's why I am wondering if there is a possibility to pause the recalculation of the indicator.
There is a situation when the indicator is on M5, but it is called once an hour for example. It turns out that the indicator will be calculated in the Expert Advisor idly every 5 minutes for the sake of calling it once an hour.
Can I rewrite the indicator so that it calculates hourly as well?
trading is going on M5. It is not known when the indicator will be called. It could be once every two hours, or it could be three times in an hour. The indicator is used to confirm the decision to trade.
Hello, Could you please tell me,
1)What to do with errors likeTRADE_RETCODE_LOCKED,TRADE_RETCODE_FROZENand in which case request is blocked or position/order is frozen?
2)Also I wonder what to do withTRADE_RETCODE_INVALID_FILLand in what case it occurs?
Hello, Could you please tell me,
1)What to do with errors likeTRADE_RETCODE_LOCKED,TRADE_RETCODE_FROZENand in which case request is blocked or position/order is frozen?
2)Also wondering what to do with TRADE_RETCODE_INVALID_FILLand in which case it occurs?
1) Check the forum search. It was discussed about a year ago.
2) Look in the ENUM_ORDER_TYPE_FILLING reference . Probably a mismatch in the trade request for the specified "execution order type" to the execution mode and will result in the specified return code.
For example ORDER_FILLING_FOK and SYMBOL_TRADE_EXECUTION_MARKET.
I have a suspicion that if the indicator is activated through iCustom, it is calculated on every tick. And it doesn't depend on the calls to it through the CopyBuffer. Is it correct?
If it is correct, then is it possible to disable the calculation of indicator and enable it only before calling the CopyBuffer?
If I understood you correctly, then you can try to limit calculations on next ticks by example from iFractals help (see multiple conditions in OnCalculate).
Perhaps, you can also flag in OnCalculate the initial execution of indicator calculations for all necessary bars and check the server time of the terminal, and after it happens, to reset the flag to false, thereby allowing the recalculation, and set it to true again... and so on.
Or even so: write an external function with calculations, call it in OnInit, where it will run once at first start of indicator (as well as when changing TFs and etc., that occurs at the user's initiative), and then call the same function in OnCalculate in the second way (at the specified time on the server and by flagging).
But the first method is good, not only doesn't load the processor with full recalculations (often leading to no new results) at every tick, but won't even do full recalculations at a given time interval, and will only calculate the newest bars (if at every tick, then one new one, and if once t, then several accumulated during this time)... Although this version is better to check personally, I can be wrong... Also, everything depends on the specific purpose of the indicator. If it depends on a large or even the whole market history, then you can't get rid of recalculations of the whole history.
Didn't get the humour of the joke (writing an indicator, though it makes no difference):
Compiles without errors or warnings.
Compiled with1 error(s), 0 warning(s): 'elements' - invalid index value.
What can be past the obvious common sense here?
What can be past the obvious common sense here?
the number of array elements is specified by a constant
If the number of elements is not known beforehand, use ArrayResize to set the size using variables.
This is the basics of c++.
So either