Wuhan, Hubei, China
Experience: Beginner
Platform: NinjaTrader
Broker: Interactive Broker
Trading: Stocks
Posts: 272 since Jun 2014
Thanks Given: 306
Thanks Received: 165
|
Hello!
I've encountered some difficulties when programming indicators in NT7,
Thanks to many threads that talk about adding button to the toolbar of NT7, I succeeded in putting my own diy buttons. The purpose of these buttons is to provide a simple way to display and hide indicators in the chart.
For example, I progammed a indicator to show the bar number since the begin of a session. Once the button is clicked, the numbers display on the chart can be hidden or display.
I achieve this function by calling ChartControl.Indicators to display/add/remove indicators. Normally, the button works fine. BUT, when the indicator is loaded and displayed on the chart, then using Ctrl+Shift+F5 to reload history data will certainly cause a crash of the whole NT program.
- If add indicator manually from the NT indicators window, a reload will not cause any problem
- If the indicator is hidden by clicking the button, a reload cause no problem
The bug must be in the button indicator, could any one help me find out reason, OR is there another to achieve the same result? Thank you!
Please find my code in attached files
Aaron_BarNumber.cs
_Show_BarNumber.cs
|