Hi,
This adaptation of the Edit example code populates the Edit text with the spread when the EA loads, but I need it to update the text with the current spread with each tick. I found solutions using the old object oriented approach but not the new object oriented approach. I tried updating using:
EVENT_MAP_BEGIN(CControlsDialog)
ON_EVENT(ON_CHANGE,Spread,OnChangeEdit)
EVENT_MAP_END(CAppDialog)
and within OnTick() and OnSetText() but couldn't get anything to work. Does anyone have or know of some code that will or can be made to work for this task? Thanks in advance.
What I did was to create a function within the CControlsDialog class, e.g. UpdateSpread(double newSpread), which contains the line m_edit.Text(string(newSpread)); for example... and I'll just call that function from my OnTick()/OnCalculate() whenever necessary.
Seng Joo Thio: Thanks for teaching me how to catch this kind of fish. I will be able to eat for a while now. I took a more generalized approach so that the code is not specific to Spread and could be used in other contexts. The attached code seems to be working, but let me know if there is a better way.

- 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,
This adaptation of the Edit example code populates the Edit text with the spread when the EA loads, but I need it to update the text with the current spread with each tick. I found solutions using the old object oriented approach but not the new object oriented approach. I tried updating using:
EVENT_MAP_BEGIN(CControlsDialog)
ON_EVENT(ON_CHANGE,Spread,OnChangeEdit)
EVENT_MAP_END(CAppDialog)
and within OnTick() and OnSetText() but couldn't get anything to work. Does anyone have or know of some code that will or can be made to work for this task? Thanks in advance.