I'm experimenting with deleting unwanted handles. In a simple example, without the IndicatorRelease(ma_handle); lines, everything works fine and fast.
But it almost hangs the system in OHLC mode.
To create and delete indicator handles at every tick is wrong. It's like stopping and starting your car at every traffic light and before every pedestrian crossing.
Rosh: Creating and deleting indicator handles on every tick is not right. It's like stopping and starting your car at every traffic light and before every zebra crossing.
And I want to be more specific about the handles.
If the handles were not removed during deinitialization (IndicatorRelease) and the program was removed from the chart at the same time, are the handles automatically removed?
One more thing. The reference says it saves memory. By how much? If I could give you some figures on how much resources are consumed by indicator handles.
If the handles were not deleted (IndicatorRelease) during deinitialization, but the program was deleted from the chart, are the handles automatically deleted?
Yes, if the terminal runtime system detects a derelict handle that is not claimed by anyone, it will be deleted automatically. I cannot tell you the lifetime of such a handle right now.
One more thing. The reference says it saves memory. By how much? If you can give figures, how much resources are consumed by indicator handles.
If the same indicator is requested from 10 charts, then the economy is 10 times. If so, calculate the number of bars on which the indicator is calculated and multiply by the number of indicator buffers, multiply by the size of double and don't forget the memory of colour buffers, if there are any.
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
Rosh: Creating and removing indicators handles at every tick is wrong. It's like turning your car off and on at every traffic light and before every zebra crossing.
It was a model. In Expert Advisor the function is executed on a new weekly bar, new indicators are created and mathematics is done. Then it has to be cleaned up... So, when activating IndicatorRelease line it almost freezes... It is enough to remove it, and everything flies in spite of all rubbish.
Can you tell me in which cases the value of a tick may differ depending on whether the position is currently in profit or loss?
SYMBOL_TRADE_TICK_VALUE
SYMBOL_TRADE_TICK_VALUE_PROFIT
SYMBOL_TRADE_TICK_VALUE_LOSS
Need to get the result of the last transaction. What am I doing wrong? :
Need to get the result of the last transaction. What am I doing wrong? :
I think it goes like this
I think it goes like this
I'm experimenting with deleting unwanted handles. In a simple example, without the IndicatorRelease(ma_handle); lines, everything works fine and fast.
But it almost hangs the system in OHLC mode.
I'm experimenting with deleting unwanted handles. In a simple example, without the IndicatorRelease(ma_handle); lines, everything works fine and fast.
But it almost hangs the system in OHLC mode.
Creating and deleting indicator handles on every tick is not right. It's like stopping and starting your car at every traffic light and before every zebra crossing.
And I want to be more specific about the handles.
If the handles were not removed during deinitialization (IndicatorRelease) and the program was removed from the chart at the same time, are the handles automatically removed?
One more thing. The reference says it saves memory. By how much? If I could give you some figures on how much resources are consumed by indicator handles.
And I want to clarify about handles.
If the handles were not deleted (IndicatorRelease) during deinitialization, but the program was deleted from the chart, are the handles automatically deleted?
One more thing. The reference says it saves memory. By how much? If you can give figures, how much resources are consumed by indicator handles.
Creating and removing indicators handles at every tick is wrong. It's like turning your car off and on at every traffic light and before every zebra crossing.
It was a model. In Expert Advisor the function is executed on a new weekly bar, new indicators are created and mathematics is done. Then it has to be cleaned up... So, when activating IndicatorRelease line it almost freezes... It is enough to remove it, and everything flies in spite of all rubbish.