TradeTimer for Ninjatrader 7: Installation and Usage Guide

TradeTimer is a GUI interface and shared code library I created to allow Ninjatrader users to have one central control for their auto-trading strategies. TradeTimer allows quick on/off control for processing entries, as well as automatic time-based management. Currently, NT7 is required to use TradeTimer.

Why TradeTimer?

TradeTimer solves a few problems that are present in NT:

1. If you change parameters in a strategy, the chart is reloaded and you lose any recorded real-time data, such as bid/ask volume. Changing them through a separate GUI like TradeTimer preserves your data.

2. Although you can enable/disable strategies in NT7, this setting applies to the entire strategy, shutting the whole thing off if disabled. TradeTimer allows you to turn off entries only, letting your strategy continue to run and process data, manage exits, and so forth.

3. Strategies must be manually enabled at the time you wish them to start trading, and manually disabled if you want to stop at a certain time. This can be solved with custom scripting to check against the current time. With TradeTimer, that logic is already built in. Plus, the GUI allows you to change the time parameters on the fly without losing any data.

TradeTimer also lets you easily select a directional bias. If you anticipate a trend down day and don’t want to go long, you can select short entries only. This can also be changed at any time without loss of data.

Installation and Setup

After downloading TradeTimer, go to the Ninjatrader Control Center window, and choose “File”, “Utilities”, and “Import Ninjascript”:

Browse to the TradeTimer file and click “Open”. The files will then be imported.

Next, you go to a chart, and add the “TradeTimer” indicator to the chart:

Enter the license key you received for TradeTimer in the License Key parameter box, and click “Ok”. If your key is invalid, you will get an error message that you haven’t entered a valid license key and TradeTimer will be disabled. If your key is valid, you can start using TradeTimer right away!

Using TradeTimer

Begin by clicking the “Show TradeTimer” button in your chart toolbar:

You will see the TradeTimer window appear, as shown below:

Note that the “Show TradeTimer” button on the chart toolbar has changed to “Hide TradeTimer”. You can click this button to hide/show the TradeTimer panel. The controls will continue to be active as long as the TradeTimer indicator is running on the chart.

The TradeTimer controls are explained below:

There are two “sessions” that you can set. You don’t have to use both, but if you want to have a morning session and an afternoon session then the capability is there. You enter the start time and end time in the appropriate text box. The times are entered as HHMMSS in 24 hour local time on your machine. If you wanted to trade 10:30 am local time to 2:30 pm local time, you’d set them as “103000” and “143000”, respectively.

Next to each session is a “Use” check box. If the box is checked, then the corresponding session time window will be used to check if entries can be made. If neither are checked, then no time period is allowable and no entries can be made.

Finally, at the bottom are two toggle buttons: “Activate Long” and “Activate Short”. These allow you to filter direction in the allowed entries. If neither are engaged, then no entries will take place. If both are engaged, then long and short entries are allowed if within the time session windows. If only long is selected, then only long entries will be allowed, and similarly for shorts with the short toggle. This is helpful if you have a directional bias to the market. These buttons and time sessions can be changed on the fly and are effective immediately. If you want to stop taking entries for a time, but still want your strategy to run, you can shut both toggles off and no entries will be made, but exits, stops and targets can still be triggered. Just toggle them back on when you are ready.

Now, some examples. If you set the controls like this, you can take long or short entries from 9:30 am to 11:30 am local time:

If you set the controls like this, then you will only take long entries from 9:30 am to 11:30 am, and then from 1:30 pm to 2:30 pm :

And if you set the controls like this, then you will not take any entries at all, even though the toggles are enabled, because you haven’t selected any permissible time windows :

Incorporating TradeTimer Into Your Own Strategies

TradeTimer doesn’t actually control any of your strategies on its own. All the controls for TradeTimer are incorporated into the TradeTimer indicator–the GUI, the time window logic and directional filtering. Your strategy needs to look for some parameters that are outputs of the TradeTimer code and handle them appropriately. To set up your strategy to make use of TradeTimer features, all you have to do is check against two global boolean variables inside your strategy:

ProTT.longentryenable
ProTT.shortentryenable

Any time you want your strategy to make an entry, you simply add a check to your regular signal logic for if the corresponding bool is true. As a very crude example, say I wanted to go long if a bar closed above the open, and go short if a bar closed below the open. I want entries to be filtered by TradeTimer, but I still want to use the close>open and close<open as exit signals at all times. I could use code like this:

if (Close[0]>Open[0])
{
if (ProTT.longentryenable) {EnterLong(1);} //New Entry
else {ExitShort(1);} //Just exit
}
if (Close[0]<Open[0])
{
if (ProTT.shortentryenable) {EnterShort(1);} //New Entry
else {ExitLong(1);} //Just exit
}

In this code, if the TradeTimer is enabled and the settings fit the time of day and the direction I have set, then a reversal signal will reverse my position. If I deactivate the TradeTimer entries or the time of day moves outside permissable windows, then a reversal signal will only cause me to exit. No opposing position will be taken. The one instance of the TradeTimer indicator will control all of the strategies that you use it with. So if you set it up to run in 4 different strategies, and toggle the short entries off in the TradeTimer control, then all the strategies will ignore short entries.

I have created a sample strategy that has the above code for use with TradeTimer as a means of illustrating how it works. The strategy WILL LOSE YOU MONEY if you actually try to trade it. It is meant as a teaching tool only! The strategy source is freely open and available, but the TradeTimer code is proprietary and requires a license to use.

So How Do I Get TradeTimer?

Just download the “TradeTimer.zip” file from the NinjaTrader Files section of my downloads site and import it into Ninjatrader according to the installation instructions above. That package includes the sample strategy source code. The sample strategy is also available separately in the Ninjascript Source page of my Google site.

The one-time license fee to use TradeTimer is $100. That’s just 1 ES point on 2 contracts, or only $0.20 on 500 shares of a stock. You can pay through PayPal or by credit card by clicking here:

Make sure to include your Machine ID so the appropriate license key can be sent to you. You can find your machine ID by clicking “Help”, then “About” in the Ninjatrader Control Center window.

If you want me to set up your existing strategies to use TradeTimer, email me and give me a description of your needs and I can give you a price quote for my time. If you want to do it yourself, ask questions and I’ll offer tips and answer questions freely. Also, if you have needs for an entirely different customized GUI control panel or other trade automation, you can contact me for a price quote!

16 Responses to “TradeTimer for Ninjatrader 7: Installation and Usage Guide”

  1. TradeTimer for NinjaTrader 7: Control Auto-Trade Strategies by Time and Direction « Read the Prospectus Says:

    […] TradeTimer for NinjaTrader 7 […]

  2. Gentle Says:

    Is source code included?

  3. Prospectus Says:

    For the sample strategy, yes. For the TradeTimer GUI, no (for now). I realize people will want to make their own GUIs, and I have no problem with that. I’m still thinking about the source thing.

  4. David Palmer Says:

    Dear Sir, I am working with several other guys in our trading group to develop an autotrade program on either Ninja or Sierra Charts. I ran across your indicator and wondered 2 questions. First on your current indicator could another time and end session be added to give you 3 different times of day to trade? Second if we decided to go with Sierra charts do you have the ability to create the same indicator that you have in Ninja for Sierra charts. We would appreciate your response and hope that we can work together on this project. David Palmer

  5. Prospectus Says:

    I can add whatever you want to the ninja GUI. I’d need to look into Sierra as I haven’t worked with it before.

    You can email me for more discussion if you like: readtheprospectus at gmail.

  6. Ismael Says:

    Hi, I noticed that you want the machine ID, so what happens if my
    machine ID changes after I buy the indicator? I don’t want to go through
    the hassle of emailing you each time I change my machine.

  7. Prospectus Says:

    MachineID is pretty standard for Ninja licensing. How often do you change your machine?

  8. Ismael Says:

    This is not a subscription, it is a one time fee so I’m not sure why you’ve
    to inconvenience your comstomers by demanding that you’ve to have their machine ID. I like the indicator but if you insist to have my machine ID, I’ll have to look somewhere else for this indicator.

    Thanks.

  9. Prospectus Says:

    I’m not demanding anything. I just asked a question of why you need to change ID’s so often.

    Two reasons why I wanted to do it this way:

    1. It handles the license so my indicator doesn’t get redistributed without my consent.

    2. It’s convenient for me to distribute the software in this way.

    Now my convenience isn’t important, but protecting my IP is. I don’t want to send out an unlicensed version of the indicator package, but I don’t want to alienate customers either.

  10. User input to running NT strategy - NinjaTrader Programming Says:

    […] Thanks for all your suggestions! 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? Thanks! Try the link below: TradeTimer for Ninjatrader 7: Installation and Usage Guide Read the Prospectus […]

  11. Amadin. Says:

    I bought TradeTimer for NT7 indicator a while back from this site.
    Recently my PC crashed and I’ve to buy a new one. I installed TradeTimer on the new PC but it won’t accept the license key. Could someone please get back to me so I can resolve this problem
    with the indicator.

    Thanks.

  12. Prospectus Says:

    Email me readtheprospectus at gmail

  13. Prospectus Says:

    I’ve emailed you several times but you haven’t been getting them. Check your spam filters!

  14. Prospectus Says:

    I just sent you another email

  15. Prospectus Says:

    I’ve been emailing you over and over. I can see your emails in my inbox and I’ve replied from several different accounts: One from readtheprospectus at gmail and one from readtheprospectus at yahoo. My replies are not getting through to you. I don’t know why?

  16. Prospectus Says:

    Since you aren’t getting my emails, here’s the license key for you:
    E43D88DB5A78D067137DA19AB6E6E00C
    Please let me know if it works. I can see your emails even if you’re not getting mine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 110 other followers

%d bloggers like this: