The communication structure is there, you just have to use it. My strategy reports back all sorts of info, like trade status, if the strategy is running, or paused, what account is it running under, equity, etc. The most important thing to me is that the indicator periodically polls the strategy and asks it are you alive?, to which the strategy better answer yes I am! Nothing frustrates me more then seeing a great trade but am unable to get in because the strategy was not alive for some reason. As a scalper those few seconds trying to fgure out what's going on, will cost me a trade.
I have noticed at times the Ninja strategy (in the strategy tab) shows as active but it is not really....the OnBarUpdate appears not to be entered even though there is lots of price action. Is this what you are referring to?
Sometimes a strategy just stops responding, or is slow, or is in some startup mode, or I may have paused or stopped the strategy during the day and forgot to turn it back on, etc. The indicator periodically polls the strategy, and puts a status on the chart saying if the strategy is alive or not, so I know just by glancing at the chart that my strategy is running, paused or down.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
The following user says Thank You to monpere for this post:
I also use a feedback function that shows me running/paused. That’s the visual part.
I did two things to solve the problem:
Leaving OnBarUpdate empty. Instead I use OnMarketData (and OnOrderUpdate, OnExecution). This way the strategy is much busier (and faster) and always ready. It is not that much CPU consuming as only a very little part of the code is active when I have no order or position. Most of the code is only active when a command or execution is on the way.
I did outsource every variable that does make any sense for both indicator and strategy to the global section. This way they always have something to chat (and keep themselves awake and ready. This brings the two parts – in a conceptual sense - closer together.
Off-topic: I did outsource the globals to a separate indicator that is always running in the background. All the problems like what to start first or errors when using multiple strategies or the (unwanted) reset of variables by changing time-frame, instrument etc. are gone.
The following user says Thank You to terratec for this post: