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
Then, during the processing of events (OnTick, OnChart, etc.), you should read the current state of the "Algo Trading", and when it is off, you release the indicator handle.
And when it is on again, you will need to reinitialise the indicator handle. The best way, is probably to create a class object for the indicator so that you can initialise and release it on demand.
Here is some sample code to get the state of when trading is allowed or not during various situations ...
do i need to add this code to indicator ? there indicator code
Then, during the processing of events (OnTick, OnChart, etc.), you should read the current state of the "Algo Trading", and when it is off, you release the indicator handle.
And when it is on again, you will need to reinitialise the indicator handle. The best way, is probably to create a class object for the indicator so that you can initialise and release it on demand via the object's methods.
Here is some sample code to get the state of when trading is allowed or not during various situations ...
If I don't misunderstand. For example, should the indicator be in such a way that it will not work when auto trading is turned off, so that the indicator will not be able to send an event?
You can do it both ways. You can either have the indicator stop sending the custom events when "Algo Trading" is disabled or you can have the EA release and reinitialise the handles as needed.
THİS CODE WORKİNG BUT A WARNİNG OCCURS ( possible loss of data due to type conversion ) line -->
nothing is changed same warning
thanks works fine :)