I have a strategy which I'd like to "pause" occasionally to avoid some clearly risky entry locations or times. In this case the general "disable" function is not a good way to do it because of the way my strategy prepares and locates the entry areas before triggering an entry, so I don't want to close/restart the strategy at that point as it would start strategy calculations from the scratch again thus missing this previously calculated entry area. I just want to inhibit any actual entries at some times without disabling the whole strategy.
So, I would like to interact with the running strategy via a dialog screen or button to put strategy to "idle" (ie not to take entries but still to keep calculating strategy as normal) and then later turn it back on "active" to let the strategy to take the entries again as normally. This maybe could be done using a check box dialog on the chart? Would somebody be able to tell / point me how to do this? Any C code example would be really helpful. I just need an example of how to build a chart dialog box object and how a running strategy would read it's input real time.
Afaik, when the strategy is running (i.e. enabled), it locks all user input. Otherwise, you could just use a region var.
So, the only thing that I can think of is to have a file read on every call to OnBarUpdate (or maybe on every bar). When you want to disable the strat from taking entries, edit the file to include some value that the strat reads to disable entries. Edit it back to take 'em again.
Note: haven't tried this ...
Last edited by kandlekid; June 21st, 2011 at 04:12 AM.
You can affect the strategy variables, but NinjaTrader don't offer any support. You have to know C# well and how to link into a DLL which you program to pop up a dialog box to accept the input. Beyond that I know nothing, sorry - except that I know that people have done it or had it programmed for them.
As for placing your own buttons on the NinjaTrader menus - I'm watching this thread with interest to find out if anyone can confirm that it's possible.
You can discover what your enemy fears most by observing the means he uses to frighten you.
What I'm doing is adding a button on the toolbar, which change the value of a boolean. This boolean is tested before each potential entry, and the order is not set if the boolean variable is false.
I think we have such button examples in the forum, here for example.
Usually in trading, those who know don't talk, and those who talk don't know. (Al Brooks)
success requires no deodorant! (Sun Tzu)
The following 3 users say Thank You to sam028 for this post:
Sam028, your method looked like one that would work in my case. I just need a user definable, real time "on/off flag" that the strategy could read before triggering any order. However, I'm not Elite member and couldn't access the toolbar example link you posted... Any chance to get that example via pm?
Elite stuff is not to be shared to non-Elite members so please do not ask for someone to PM you something you don't have access to.
But I agree the toolbar is the recommended method, this is what I've used in the past for myself and customers who hired me for strategies.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.