Medved Quotetracker is one of the best stock trading software out there. The only feature that it lacks is the ability to automate trading based on “trading systems”. With the help of Bracket Trader, Mailenable and Perl, I’ve created a solution that remedies this problem. And best yet, all of the software is downloadable for FREE.
Note: This solution is meant to be used with an Interactive Brokers brokerage account. Interactive Brokers is one of the best online brokerages out there offering low commissions and the ability to trade pretty much any stock, options, and/or futures in the world.
To get started, you will need to download all of the following software:
- Medved Quotetracker
- Bracket Trader
- Mailenable
- ActiveState Perl
- Boogster’s ATS Perl Script
- Interactive Broker’s TWS
Quotetracker is a charting/alerts/trading software. Bracket Trader is a software that manages your trade once it’s been placed. Mailenable is a free mail server (smtp & pop3) software. ActiveState Perl is one of the most widely used scripting software out there. Boogster’s ATS Perl script is a simple email client that checks for email every 4 seconds (default) and enters a trade into Bracket Trader when a new alert is found. Interactive Broker’s TWS is required for placing the actual trades.
To briefly explain what this automated trading system is going to do, first off you need to be somewhat proficient with Quotetracker and its paintbar editor. If you do a search for “paintbar” in the Quotetracker help file, you can find a more detailed explanation of how the paintbar editor works. I have also written up a few examples of how to use the paintbars: TTM Squeeze & TTM Trend.
Here’s a flowchart of how the ATS works:
Now, let’s get everything set up.
Install Medved Quotetracker and set up email alerts
-
After Quotetracker has been installed with the default settings, open the “Portfolio and Alerts” window by clicking on the “Alerts” menu, then clicking on the “Email Templates” tab.
-
Create a new email template by clicking on the “New Template” button.
-
Enter the following parameters into the new template:
- Template Name: ATS BUY
- Send To: ats@127.0.0.1
- From Email Address: ats@127.0.0.1
- Mail Server Address (SMTP): 127.0.0.1
- Port: default
- Message Body: ORDER;<SYMBOL>;BUY;entry
- The end result should look like this:
-
Create a second template by clicking on the “New Template” button.
-
Enter the following parameters into the new template:
- Template Name: ATS SELL
- Send To: ats@127.0.0.1
- From Email Address: ats@127.0.0.1
- Mail Server Address (SMTP): 127.0.0.1
- Port: default
- Message Body: ORDER;<SYMBOL>;SELL;entry
- The end result should look like this:
-
All done. Quotetracker is now setup to handle the alerts.
Install Mailenable mail server
- After you’ve downloaded the Mailenable software, run the installation and accept all of the defaults. When the setup prompts you to enter a “Domain Name”, enter “127.0.0.1″.
-
After you’ve finished installing Mailenable server, you must create a new mailbox account via the Mailenable Administrator, which can be started by clicking on the Start button, “All programs”, “mailenable”, then “Mailenable Administrator”.
- Now, drill down through the left side menus until you reach “Mailbox”. Right click and select “New”, then “Mailbox…”
- When the “Mailbox Properties” dialogue box pops up, enter “ats” for the “Mailbox Name” and “ats” for the “Password”.
- Now, we need to disable the log files to prevent Mailenable from eating up all of your hard drive space. Drill down through the Servers menu on the left hand side, until you reach “POP”.
- With the “POP Properties” dialogue box open, click on the “Logging” tab, then uncheck all of the logging boxes.
-
All done. Mailenable mail server is now setup to handle the Quotetracker alerts.
Install ActiveState Perl
-
This should be fairly simple. Just download the software from the link above, then unzip and double click on “installer.bat”. Accept all of the default options.
-
After you’ve installed ActiveState Perl, restart your computer.
Install Interactive Broker’s TWS
-
Download and install the latest version of Interactive Broker’s TWS. The setup should be pretty straight forward. It is recommended that you install the software in the “c:\JTS” folder. Also, after installation, make sure the “Enable ActiveX and Socket Clients” box is checked by click on the “Configure”, “API” menus. This will allow Quotetracker and Bracket Trader to transmit and receive data from Interactive Brokers.
-
All done. If you don’t know how to setup IB’s TWS, then this ATS is probably not the right setup for you.
Install Bracket Trader
-
Download the latest version of Bracket Trader from the link above. It is recommended that you install the software to the “c:\JTS\BracketTrader” directory.
-
Remember that you must run a separate version of Bracket Trader for each stock/futures that you’d like to trade via the ATS. If you are planning to do this, then you will have to create a new directory in the c:\JTS\BracketTrader directory, copy the BracketTrader.exe into that new directory, and run Bracket Trader from that new directory. Otherwise, you will only be able to trade one stock/futures at a time. More information about trading multiple contracts/stocks can be found on the Bracket Trader website.
-
Also, it is recommended that you disable the “Monitor for Extra Positions” option under the Preferences menu in Bracket Trader. This may cause some problems if not disabled.
-
Make sure you establish your stops and targets strategy before you start the ATS.
-
All done.
Install Boogster’s ATS perl script
-
Download the latest version of the script from the link above. Unzip the ats.pl file and place it into the c:\JTS\BracketTrader directory. In order to run the script, you must click on the start button, “run”, then type in “c:\perl\bin\perl c:\jts\brackettrader\ats.pl”. If you want to change your default contract size or brackettrader default directory, then you can edit the ats.pl file in notepad and change the parameters as needed.
-
All done.
Create a simple trading system
Now that we have all of the software installed, it’s time to put everything together to make it a completely automated trading system. Restart your computer, then start all of the following applications:
-
Medved Quotetracker
-
Interactive Broker’s TWS
-
Make sure “enabled ActiveX socket clients” is checked
-
-
Bracket Trader
-
Orders will be entered via a text file. So, you will have to click on the “Preferences” menu, then “External Orders”, then check the “3rd Party ATS Entry only” option. Select “Yes” when asked if “you really want to activate ATS”. When it prompts you for a file name, enter “c:\jts\brackettrader\signals\<ticker symbol>.txt”. Replace “<ticker symbol>” with the actual ticker symbol (e.g. YM or ER2 or NQ or ES). Then, click “start”.
- NOTE: If the files in the “signals” directory are not being created, then make sure that you give “everyone” read/write access to that directory. (updated on 11/2/2008)
-
-
Boogster’s ATS perl script
-
Click on the start button, then run and type in “c:\perl\bin\perl c:\jts\brackettrader\ats.pl”
-
A command prompt should pop and say “running…”, “running…” every 4 seconds.
-
Now, we’re ready to setup a simple trading system in Quotetracker. For this example, we’ll just use a 8 EMA and 20 SMA crossover. A buy signal will be generated when the two moving averages cross over to the upside and a short signal will be entered when the two moving averages cross over to the downside. We’ll be using a 15-minute intra-day chart of the YM for our signals.
So, open up a 15-minute intra-day chart of the YM, then right click on the chart and click on “select indicators”. Add the 20 SMA and 8 EMA top indicators, then add two “Paintbar – Top” indicators. It should look something like this:
Next, click on the edit button for one of the paintbars, then click on “edit paintbars”. Click on the “Add New” button to create a new paintbar. Name it “8EMA 20SMA BUY”. Add a new rule and enter the following line into the new rule:
if SMA(20)[2]>EMA(8)[2] and SMA(20)[1]<EMA(8)[1] and Bar Low<=EMA(8) set color to Green
Click on the “(Alert off) Properties” button and make it look like this:
After you’re done, click on the “OK” button and your finished paintbar should look something like this:
Click on the close button, then select the new paintbar that you just created. It should look similar to this:
Click on the “OK” button. Now you have to create a paintbar for entering Short Sell order. Follow the above procedures, but use the following code for the new paintbar:
if SMA(20)[2]<EMA(8)[2] and SMA(20)[1]>EMA(8)[1] and Bar High>=EMA(8) set color to Red
Also, make sure that your email alert is set to “ATS SELL”. The finished paintbar should look like this:
The setup of our simple trading system is complete. Make sure that you save this newly created chart template by right clicking on the chart and selecting “save chart template”. Now, if you look at your 15-min intraday chart of the YM, you should notice some red and green arrows representing your buy and sell entry points.
For the above trading system, I would recommend using a 20 tick stop and 20, 50, 100 targets with a 25 tick trailing stop. That’s it, you’ve created your first automated trading system in Quotetracker!
Remember, this is just a workaround that I created. It is by no means a foolproof way of automating your trading. I would recommend that you fully understand what we’re doing here before you implement it on your own system. Quotetracker is a powerful software that I’ve been using for as long as I can remember and Bracket Trader has been an essential part of my trading as of late. It’s great to be able to combine both of these powerful tools into a simple yet effective automated trading system.
Good luck with setting it all up!
UPDATED 11/15/2008
High Probability Trading was kind enough to create a video tutorial of the entire setup process, along with a live working example of the automated trading system. The videos are in 6 parts and you can view them all here:
Part 1 Part2 Part 3 Part 4 Part 5 Part 6
Great stuff man! Maybe we can compile a list of working trading systems and see which one works best.














“Did i ever tell you that you’re my hero. You’re everything, everything, i wish i could be…”
↓ Quote | Posted April 16, 2007, 12:39 amwow! that’s one of the best directional walkthroughs that i’ve read in years (and i read manuals). thank you for taking the time to share all of your work and time — especially for free.
↓ Quote | Posted April 16, 2007, 8:35 amA one word description. . . Awesome!
Jim
↓ Quote | Posted April 16, 2007, 9:40 amThank You for this 5 star write-up.
↓ Quote | Posted April 16, 2007, 9:44 amWhat does all that stuff do again?
↓ Quote | Posted April 16, 2007, 9:57 ami am a kenyan student doing research on automated trading system and i hereby wish to request your office to provide me with all information about the automated trading system efficiency in trading of shares in the stock exchange, including its background, origing and the latest research done about it.
↓ Quote | Posted April 24, 2007, 3:18 amexcellent idea, great tutorial, gererous spirit of sharing. Well done
I have a bit of a problem though. my paintabr printed correctly all the signals on the chart. But the email system triggered only few of them My alert defaults are:
Duplicate thershold 0 min
Check Alerts Every 2 sec
can you help please
↓ Quote | Posted May 24, 2007, 4:16 amSet your timeout to 360 and your duplicate alert threshold to 5mins. That should take care of the problem…
↓ Quote | Posted May 24, 2007, 8:50 amAlso if your looking for commercial solution, the excellent Smartquant.com suite of automatic trading products (OpenQuant & Quantdeveloper) have a QuoteTracker plugin among many others…
↓ Quote | Posted July 13, 2007, 4:51 amThanks for the tutorial! This looks like a great start for an ATS.
↓ Quote | Posted October 19, 2007, 11:04 amWonderful walk-through. Very well done. Will be following trying it out soon on a simulated IB account, their fills are pretty realistic for a sim account (I have traded it side-by-side with my live account).
↓ Quote | Posted November 1, 2007, 10:34 amTried it out, but the Perl script keeps stopping on its own. All paths checked. Ideas?
↓ Quote | Posted November 5, 2007, 5:07 pmFixed the Perl script and have all the elements working except for BT, which barfs all over itself when receiving an opposing order. Example: BT is configured to accept ATS entry and exit signals. When BT is long and receives a short order, it rejects the new order and leaves the long trade alone. Ideas?
↓ Quote | Posted November 6, 2007, 1:07 pmbigjim, what was wrong with the perl script?
↓ Quote | Posted November 6, 2007, 8:16 pmBigjim, I don’t think that I was ever able to get the “exit” to work because this system does not “remember” if it has an open order or not. In order for the “exit” to work, I tried placing two orders one after another…the first to close an open position if there is one, and the second, to enter into a new short position, but that didn’t work for me. So, right now…it only places orders and waits for the stops and targets to exit out of the position…
↓ Quote | Posted November 6, 2007, 8:42 pmboogster, the Perl script just needs to be tailored to BT. I sure wish QT would simply trigger a trade based on the indicator crossover. Thanks for the info on entry/exits. I applaud your documentation! I am still looking for an automated way to trigger entries and automatically close any open position when a new trigger is received. I have my trading system refined, but getting a machine to follow instructions is not my strong suit, so I am looking for a programmer that can configure such a system for me, and tell me how its done so I can do it myself next time I re-image my box. I am not aware of any black-box (off-the-shelf) solution to this need, and I don’t know why, as such a solution would be of value to us whose system works. Again, thanks for your feedback and your workaround.
↓ Quote | Posted November 13, 2007, 9:21 amI would like to test this procedure, however I can’t find the perl script on the mentioned site. It seams there is a 21-day trial, but there is a list of various products.
Can you post exactly the link for perl script?
Kind regards,
Candido Rodrigues
↓ Quote | Posted November 18, 2007, 4:25 pmThe perl script can be found on the link at the top of this site.
http://www.boogster.net/stocks/ats.zip
↓ Quote | Posted November 18, 2007, 4:30 pmBoogster,
Do you know hot to set up paintbars for a stochastic? It’s easy for two SMAs, but a stochastic is two signals in one indicator. How would you go about this?
↓ Quote | Posted November 24, 2007, 7:43 pmBoogster,
Do you know how to set up paintbars for a stochastic? It’s easy for two SMAs, but a stochastic is two signals in one indicator. How would you go about this?
↓ Quote | Posted November 24, 2007, 7:44 pmBy the way, in reference to our discussion on exits, I set the TimeStop for 2 minutes and, using a 3-minute chart (or 4 minute timestop on a 5-minute chart, etc), there should never be a conflict of a new signal on top of an open trade.
↓ Quote | Posted November 24, 2007, 7:46 pmUnfortunately, I too am not a coder……Any chance that you could modify the above perl script for zerolinetrader. It is similar to brackettrader. However, it is superior to Bracket trader (if you trade multiple securities) in that you just run one instance of it to trade multiple securities. It works the same way as BT….the ats uses a text file, but you have to incorporate the number of the security that was assigned to it by zerolinetrader (the data row ID #) into the email alert. The downside is it isn’t free…3 months for $30. But it is an excellent program that I use alongside with quotetracker.
Here is the link: http://www.zerolinetrader.com/doc/index.htm
After your there, just click on Automated Trading on the left hand side of the screen.
Any help you could provide would be greatly appreciated. Thanks
Sincerely,
nbbo
P.S. BIGJim…..You might want to check out Sierra Chart….also a great program that I use….here is the link if you care to check it out. http://www.sierrachart.com/
↓ Quote | Posted November 29, 2007, 4:39 amThey just implemented a trading interface that might do what you want it to do. The only problem for me is the stops don’t reside at the broker or the exchange (they hope to remedy that soon), you have to wait for them to be triggered by the spreadsheet.
boogster;
does one have to setup a signal folder inside the brackettrader directory? does one have to setup a txt file as well?
↓ Quote | Posted December 3, 2007, 12:55 amIn other words, is there a step missing to create the 3rd party transfer file that Bracket trader needs to execute?
when I ran the code the code says :
DEBUG: 1> ORDER 2>ECBOT:@YM DEC 07 3> Buy 4> entry
ORDER PLACED: cxl place, BUY, 1 , mkt, 0,0,2007……,entry
the signal is not getting to bracket trader….
any help much appreciated
↓ Quote | Posted December 3, 2007, 1:00 amBigjim…read the QT help file for paintbar instructions. I’m not going to get into it here.
↓ Quote | Posted December 3, 2007, 1:01 amnbbo…give me the format of the order entries for the zerolinetrader program and I will see what I can do…
↓ Quote | Posted December 3, 2007, 1:04 amanon…i have the perl script customized so that the text file is named whatever the security is named. So, if you’re trading the YM, then the text file will be YM.txt. But you have to create the brackettrader directory for each different contract that you’re trading…e.g.
c:\jts\brackettrader\signals\YM.txt
The text file has to be in that directory unless you modify the perl script.
↓ Quote | Posted December 3, 2007, 1:07 amI might be dense but this is what I did:
I created a subfolder under Bracket Trader called signals
I created a blank txt file called YM
I have a paintbar triggering that is obviously being picked up by the PERL code, but for some reason the perl code is not firing the order to bracket trader.
Does the fact that the code printed DEBUG and cxlplace in the second row under it mean the order is being aborted?
In the ATS.PL file I had to modify some of the folder attributes b/c they had // (two backslashes, and i was worried it would not reference the subfolder correctly).
is there any other modification i need to do to the ATS perl file? I feel the problem may be there.
P.S. Do I have to have MailEnable running in background? I have left it running in background during tests.
thx for your help Boogster
Carlo
↓ Quote | Posted December 3, 2007, 1:20 amCarlo, you shouldn’t have to modify the ats.pl file…especially not the backslashes…..
↓ Quote | Posted December 3, 2007, 1:40 amAny suggestion as to what I might be doing wrong here?
Is the reply string that comes out in the perl code what you expected?
Was I correct in setting up a blank YM.TXT file in subfolder “signals” ?
Grazie
↓ Quote | Posted December 3, 2007, 7:45 amFirst off, use the original ats.pl file. If you are getting the debug and order placed lines, then everything up to the bracket trader connection is working fine.
Did you select the “external orders”, “3rd party order entry only” from the “preferences” menu on bracket trader? When you do this, you need to select the YM.txt file from the signals directory. Also, do you have this running in sim mode or live mode?
↓ Quote | Posted December 3, 2007, 9:58 amBoogster,
I selected the external orders,3rd party order ENTRY only, made sure the bracket trader was on LIVE mode. The console then said “waiting for 3rd party transfer file”. I pointed the directory to
c:/jts/brackettrader/signals/ym.txt.
Is the cxlplace line mean anything?
I can’t think of anything else I’m doing wrong. I manually generated a bracket order an it definitely went to IB’s API…
↓ Quote | Posted December 3, 2007, 10:29 ameverything looks fine. see if the perl script is sending the buy orders into that YM.txt file. Stop bracket trader and let everything else run, then look into the YM.txt file…
↓ Quote | Posted December 3, 2007, 11:05 amstrangely on one occasion the perl script just ended abruptly (this is when I went in and changed the \\ to single \ )
c:\\JTS\\BracketTrader
and strangely the YM.TXT file disappeared from the directory.
↓ Quote | Posted December 3, 2007, 11:17 amno code shows up in my txt file, instead an error file with the following comes up
↓ Quote | Posted December 3, 2007, 6:06 pmcxlplace,BUY,0,MKT,0,0,20071203170817,entry
yep confirmed, when the paintbar is triggered an error.txt file is created in the signal folder. nothing in the YM.txt file
↓ Quote | Posted December 3, 2007, 6:19 pmI think the problem is that you created the YM.txt file. You should let BT create the file otherwise, it may have a problem accessing the file. Delete alll files from the signals directory, then when BT asks for an input file, type in the file name.
↓ Quote | Posted December 3, 2007, 6:29 pmYou are trading one of the index futures, right?
↓ Quote | Posted December 3, 2007, 6:31 pmI had been using the YM for tests up til this evening that I switched to QM since it was active and I could trigger paintbars quicker.
I edited the ATS file and substituted QM for the CL entry in the code.
ERROR.txt being generated. I’m stumped. We’re so close..
↓ Quote | Posted December 3, 2007, 6:42 pmBOOGSTER,
YM symbol is working now.
Wonder why it doesn’t work for QM?
If I want multiple contracts being monitored, where do I create the signal directories?
↓ Quote | Posted December 3, 2007, 7:18 pmYou’re killin me dude. I feel like I’m at my old IT job again. The Perl script does not work with the QM and CL because I don’t trade those securities. However, I’ve updated the ats.pl to include these contracts including the ZB, ZN, ZF, YG, ZG, CL, NG, QG, and QM….so, just download the the new ats.zip and overwrite the old ats.pl file.
↓ Quote | Posted December 3, 2007, 10:39 pmI didn’t know what you needed so I included everything. Here is the website link that includes everything below plus pictures
Here is the link: http://www.zerolinetrader.com/doc/index.htm
After your there, just click on Automated Trading on the left hand side of the screen.
*************************************************
The third party software should write one order instruction in one file with unique file name. This solution eliminates the possibility that the order instruction may be read and processed more than once.
Order Instruction Format:
The third party software must write the order instructions in following format:
Action,Order Quantity,Order Type,Tab Name,Data Row ID;
Note: “;” ends one order instruction.
Action: Buy or Sell
Order Quantity: An integer number.
Order Type: Market, Bid or Ask. Market specifies it is a market order. Similarly, Bid for buy/sell at bid; Ask for buy/sell at Ask.
Tab Name: The tab page name in ZeroLine Trader main window.
Data Row ID: The ID of the data row in the tab page. To see the ID of a data row, just right click on the table header and check Data Row ID.
Here is an example,
Buy,2,Market,ES/ZB,1;
This order instruction will send a market order to buy 2 contracts of ES (as indicated by the data row with ID 1 in the ES/ZB tab page). Since the order is related to the data row, the trade parameters associated with the data row are effective. For example, if the stop is defined for the data row, the stop loss order will be generated.
To close the position, the order instruction syntax is:
Action,Tab Name,Data Row ID;
For example,
Close,ES/ZB,1;
This order instruction will close the position on the data row with row ID 1 in the tab page ES/ZB.
************************************************8
↓ Quote | Posted December 4, 2007, 3:08 amThanks for your time.
Sincerely,
nbbo
Thanks Boogster. I managed to edit the code and add the symbols myself. System working very well now. I must thank you for your kindness in sharing this system and setting up such a functional setup.
Some musings:
a)I wonder if there is a way to query account data such that PERL code quits and /or IB flattens out all positions and rejects new signals upon hitting a hard money stop. I.e. If losses exceed max threshold, quit.
b)I wonder if instead of having a MKT order being sent, if there is a way to send a relative or offset order such as selling on the offer minus an offset or buying on the bid plus an offset. This would help add some edge to the entry.
I’ll run my systems and see how well they perform, and share accordingly.
↓ Quote | Posted December 4, 2007, 11:35 pmAny ideas of how to setup a paintbar that based on time rule flattens a position in a symbol regardless if the system is long or short?
I.e. I want to reduce GAP risk and avoid having my system stay in a position that might be entered right at the close of the market. Ie if the Nikkei closes at 5 a.m. my time I’d like to have the script flatten everything out and STOP at say 4:50 a.m.
↓ Quote | Posted December 5, 2007, 9:46 pmEnded up discovering the “flatten on close” function on bracket trader so that answers the Gap risk .
I had one question. Instead of submitting MKT orders can orders that “offset” a certain value from the bid/ask be submitted?
I.e. if the paintbar triggers a BUY can the system be setup to say:
If the mkt is 13750/13780
Buy 1 offset 2pts , so it ends up submitting a 13752 bid instead of lifting the 13780 offer?
↓ Quote | Posted December 11, 2007, 9:17 pmFeel Free to post the above information at http://www.QTusers.com forum if you like
↓ Quote | Posted December 13, 2007, 7:36 pmcongrates on quite a herculean effort to get all these basically free programs working together.
↓ Quote | Posted January 12, 2008, 12:43 pmIf you do Java, however, there is another choice, free as well:
http://groups.google.com/group/jsystemtrader
Hello boogster,
First of all thanks for the guide of automated system, I am looking for build this system by opening a IB account, I use QT from 6 months now. One question there is possible to set a trailing stop in the ATS?? I mean, the system function is that place an automatic order, than you enter the IB to set the trailing?? or ATS does all of them??
Thanks.
Michael.
↓ Quote | Posted February 15, 2008, 1:07 pmHi Boogster/All
I am trying to set this system up and it appears the Boogster Perl script has been removed. Can anyone help me out here?
Thanks
Neil
↓ Quote | Posted March 8, 2008, 12:53 pmShould be working now…
↓ Quote | Posted March 9, 2008, 11:06 amMela, as far as the trailing stop, you will have to configure Bracket Trader to handle that…
↓ Quote | Posted March 9, 2008, 11:06 amI wanted to know if this system could be modified to work with another broker instead of IB such as Velocity Futures ?
Instead of using IB and the IB TWS, I would rather use Velocity Futures via Fix 4.2 . Is this possible with Quotetracker?
↓ Quote | Posted March 10, 2008, 1:57 amSo long as Bracket Trader supports the new brokerage, then it should work fine.
↓ Quote | Posted March 10, 2008, 3:22 pmOk, I got it. You need a frontend that is compatible with the broker’s API.
I took a look. Bracket Trader, Auto Trader, and Button Trader only work with IB TWS. The only front end that works with other brokers is Tradebolt. Its combatible with Patsystems’ API and thus several brokers.
So at this point, I’ll have to try and figure out a script for Tradebolt.
↓ Quote | Posted March 11, 2008, 12:06 amThere’s also trade bullet. Check it out:
http://www.atsware.com/products/tradebullet/
↓ Quote | Posted March 11, 2008, 1:59 amTradebullet is where I got the idea from, but Tradebullet is not free.
↓ Quote | Posted April 3, 2008, 11:35 pmHi,
I installed all the functions correctly but the directory C:\Jts\BracketTrader\Signals\ is empty and how i can build the file ym.txt with buy and sell signals ? when i add the 3rd party ATS entry only from brackettrader i answer yes for the question to activate ATS service and open to file C:\Jts\BracketTrader\Signals\YM.txt and click start but the file not created.
In bracket trader i can see only the ES symbol ,how i can change the symbol to YM mini dow contract ?
Best Regards,
↓ Quote | Posted May 6, 2008, 7:58 pmAL
The text file is created by the perl script, so you will not see it until a signal has been generated. I believe that’s how it works…it’s been a long time since I’ve looked at it.
If you can’t figure out how to change the symbol to YM in bracket trader, then you probably have no business using this software, let alone trading. Seriously, you need to figure that shit out yourself, my friend.
↓ Quote | Posted May 7, 2008, 9:57 amFor this ATS to works, do you must in the market at all time?
I mean, does it work if it just buy, then exit (either target or stop is hit). Then wait for the next signal.
Thanks.
↓ Quote | Posted May 7, 2008, 5:25 pmNice grammar, Chris.
Hope all is well, Boog.
↓ Quote | Posted May 18, 2008, 12:26 amBoogster,
Many thanks!! fantastic work.
AL
↓ Quote | Posted May 18, 2008, 6:21 pmHi boogster ,
i have a problem with the bracket trader .is doesn’t recived the signal after has been generated in the directory C:\Jts\BracketTrader\Signals .everything configure well in the TWS & in Brackettrader .i was trying to install everything from beginig and nothing was change.I am testing the signals in IB Demo account and the api configure OK .
Please your advice.
↓ Quote | Posted June 3, 2008, 8:17 pmAL
Dear Mike,
Thanks for the instructions on your blog, I’ve been used QT for 6 months
now, I have downloaded all the programs and follow step by step your
instruction for the ATS, everythings seems ok like paintbar, the perl works
fine I received message in the window like “ORDER PLACED: cxlplace, SELL,1,
MKT,0,0,20080507171310, entry”, but the Bracket Trader does not receive the
transfer file: the problem is the file in the folder BrackertTrader\Signals,
The file has name “.txt” intead of “NQM8.txt” or “NQ.txt”, so it hasn’t the
name but only the extension. I am using the IB Trader Workstation ad demo
user, I don’t think it could be a problem.
Where I made the mistake?? Thanks so much for the help.
Mike
↓ Quote | Posted June 5, 2008, 4:06 pmMike , thanks this is working again.
Best Regards,
↓ Quote | Posted June 10, 2008, 4:09 pmAL
i am not receiving signal to bracket order/ ats system, if you can help me
↓ Quote | Posted June 29, 2008, 12:31 amthanks
- the paintbar generate usually order sequence like following: buy – sell – sell – sell – buy – buy – sell.
So the problem is it generates multiple sell order or buy order, and I don’t want that the system add a contract again, so if I have a short position already, I don’t want to short 1 contract again, I need just the system to keep the previous short position.
- during the trading day, the first order (buy or sell) there is not any problem, but the following order must be doubled in order to close the first order and then open a new position. at the end of the day the last order must be one contract.
I make an example: the sequence is: short (1 contract )- long (2 contracts) – short (2 contracts) – long (1 contract). So the balance after all is zero. no position is open at the end of the day.
How can I do this Mike?
thanks again
↓ Quote | Posted July 9, 2008, 12:52 pmHonestly guys…I have not used this ATS in months…the details are starting to escape my mind, but everything that I documented above should work fine.
MICHAEL, this ATS cannot manage the trade for you. Only Bracket Trader can do that. In order to go long, then short, all in one motion, you will need to close out the current position, then reenter into a new one. The best way to do it would be to create two instances of Bracket Trader and have one for longs and one for shorts. In order to close out your position at the end of the day, you should setup BT to do that for you….
If there is enough interest, I can probably go back and look into how everything works again. Otherwise, you will need to try to figure things out yourself. I’ve tried to document everything that I’ve done in the above writeup.
↓ Quote | Posted July 9, 2008, 6:19 pmThanks boog, I will try it by myself, I don’t want to bother you for this. untill today I still have some problem, I will figure out.. one question could IB demo be a problem? I am using it with the ATS.
↓ Quote | Posted July 10, 2008, 12:17 pmCan this ATS be modified to have (1)Buy, (2)Cover and (1)Short, (2)Cover? Event 1 must be triggered before event 2 can be triggered.
Thanks.
↓ Quote | Posted July 15, 2008, 11:57 amHello mike,
can you contact me by email, I have a important matter to discuss with you.
thanks.
michael
↓ Quote | Posted July 17, 2008, 12:05 pmBoogster,
↓ Quote | Posted September 7, 2008, 6:56 pmfirst I want to thank you for your really great system, it´s wonderful. But when I cannot trade cash EUR.USD .I made some changes in ats.pl in replacing Globex by Idealpro and so on but nothing worked. Could you give me some help?
I got it!
↓ Quote | Posted September 9, 2008, 10:35 am} elsif ($order[1]=~/^.*IDEALPRO:\@EUR.USD.*$/) {
$symbol= “EUR”;
$shares = $DefaultCurrencySize;
I’m a Johnny come lately, but wanna say just tried out the pieces (9/13/08) and everything still works like a gem for entry or exit orders. Just wish could use this on entry and exit orders as apparently (haven’t tried it yet) Sierra charts and BT can do. Thanks for this post. You are a genius Boogster.
↓ Quote | Posted September 13, 2008, 5:43 pmGawan, thanks for the update, I will go ahead and update the master ats.pl file.
↓ Quote | Posted September 13, 2008, 6:17 pmAl, I don’t appreciate people calling me names.
Just kidding man. Enjoy!
↓ Quote | Posted September 13, 2008, 6:18 pmtheBoogster. Checked out Sierra Chart/Bracket Trader integration, Bracket Trader order simulator and your cuil Perl script and wondered if it might be possible to have QT submit entry and exit orders to IB via BT by doing the following: 1) having the Perl script check QT’s order email to determine if it’s an entry or exit, to open and close positions, 2) modify your Perl order output file as follows: (OUTPUT, “>$BracketTraderDirectory\\signals\\$entries.txt”) or die “Can’t open file: $!\n”; and 3) select BT’s 3rd Party Entry and Exit option. BT’s order simulator seems to suggest that you can open and close positions this way. If you don’t want bracket orders to control the exit, the stope and target can be made extremely wide. Any thoughts? You’re the man.
↓ Quote | Posted September 14, 2008, 7:05 amdaBoogster. Thanks again for this amazing stuff. This is really an Awesome Possum. Been tinkering a little with the script. It does everything I could hope for, ah……. except for strategy backtesting, particle swarm optimization, reinforcement learning, etc. etc. etc. Just kidding. THANKS AGAIN
↓ Quote | Posted September 17, 2008, 4:58 pmSorry to bother again, Boogster. But can you say how I would change the perl script so it fetches QT’s email alerts in under 1 second. I changed the sleep function to sleep(1); and it drips it down to one second, but can’t figure how to go lower
↓ Quote | Posted September 18, 2008, 10:57 pmAlso does the code below cause mailenable to not fetch mail any faster than every 10 seconds? Reason I ask is because when QT’s paintbar alert sends out more than 1 alert simultaneously, they show up in the perl script with a lag of 10 seconds Thanks again for any insight you might be able to shed on this. Trying to eliminate that 10 second lag.
Perl script:
my $pop = Net::POP3->new(’127.0.0.1′, Timeout => 10);
QT alert log:
05:29:17 EMail to ats@127.0.0.1 “” – SENT
↓ Quote | Posted September 19, 2008, 5:33 am05:29:07 EMail to ats@127.0.0.1 “” – SENT
05:29:07 PB Alert: for GLOBEX:@ESZ8: OHLC 1h 1m “Short Exit-2-Forex” Rule #1
05:29:07 PB Alert: for GLOBEX:@ESZ8: OHLC 1h 1m “Long Entry-Forex” Rule #1
05:29:07 EMail to ats@127.0.0.1 “” – SENT
05:28:57 EMail to ats@127.0.0.1 “” – SENT
05:28:56 PB Alert: for GLOBEX:@ESZ8: OHLC 1h 1m “Short Exit-2-Forex” Rule #1
05:28:56 PB Alert: for GLOBEX:@ESZ8: OHLC 1h 1m “Long Entry-Forex” Rule #1
I would not check for email any faster than every 4 seconds because it takes at least a second or two to perform the action. Any faster make cause mailenable to hang. That’s the cause of your problems with the 10 second lag as well…that’s my guess…
↓ Quote | Posted September 19, 2008, 9:24 amHey Boog,
↓ Quote | Posted November 2, 2008, 3:02 pmI can’t get the active state perl to say “running” every 4 seconds like you say it should. I’m getting alerts sent from QT to mailenable, but the perl script doesn’t seem to be working. I made a walk thru video of where my error occurs.
http://highprobability.blogspot.com/2008/11/boogters-ats-trading-system.html
Any help would be great.
Sorry, there was a bug in the ATS.pl script. Try downloading it again and giving it a try. Also, make sure you give “everyone” read/write access to the c:\jts\brackettrader directory.
↓ Quote | Posted November 2, 2008, 4:19 pmHey Boog,
↓ Quote | Posted November 3, 2008, 4:47 amThanks so Much for fixing the ATS.pl script. I made a live ATS video tonight minutes after I got the fixed ATS.pl script. I’m going to be making a blog post soon about how cool your ATS setup is.
HPT
Hey Boog,
↓ Quote | Posted November 15, 2008, 6:50 amI finally made that Video tutorial on the ATS. I also modified the ATS perl script so it will take exit signals and it scans the email every 1 second instead of 4. I have the modified script available for download on my site. Let me know what you think.
http://highprobability.blogspot.com/2008/11/how-to-make-free-automated-trading.html
HPT
boogster. Everything has been working perfectly with my ats until today. I added another symbol to my BT list. And for some reason the files for the NEW symbol in the “signals� directory is not being created. Adding new symbols was not a problem in the past. Any ideas? I sent an email to Jerry Sy to find out if there is a maximum number of symbols I can create with a register version of BT. Thanks
↓ Quote | Posted November 26, 2008, 2:58 pmboogster. Never mind. Just figured out I need to add the symbols to your Perl script. Thanks anyway.
↓ Quote | Posted November 26, 2008, 3:02 pmHello,
I have a problem with the new ATS script. i got a error message in bracket trader with this message “Entry signal, not processed !!” ,when the current position is a Long position and the signal is now entry to Short. i configured 4 paint bars top with the same entry and exit criteria: the 2 headers paint bars top are the entry to short and entry to long position, and another follow 2 paint bars with the same triggers but the names are different and the mail alert are to exit from the current position exits from long and short alerts.
if somebody can tell me what I do wrong?!!
Thanks a lot,
↓ Quote | Posted November 27, 2008, 6:55 pmLA
LA,
↓ Quote | Posted November 27, 2008, 8:27 pmI had this same problem when I first tried using exit signals. The exit signals must come before the entry signals. Also, you must be using my modified ATS script in order to exit positions.
HPT
Hi HPT,
Thanks for your quick replying, I found the problem:
First i Use your new ats script but i found that when the trigger was Exit from the position the file was created under C:\jts\…\signals\.txt was dot.txt the current symbol not identify by bracket trader.
i opened the ats.pl and i found that the symbol isn’t writing in the trigger :”my($symbol)=”";
my($shares)=1;
my($ordertype)=”";
And when i change the line:”my($symbol)=”YM”;
the exit trigger was working great but what happened if i like to trade with tow symbols in the same time?
Thanks for your help and Best Regards,
↓ Quote | Posted November 28, 2008, 9:50 amLA
You have to use multiple instances of Bracket Trader to trade multiple symbols. checkout this forum topic for BT-
↓ Quote | Posted November 28, 2008, 10:30 amhttp://www.bracket-trader.com/phpBB2/viewtopic.php?t=2171&highlight=trading+multiple+symbols
Also, if the alerts occur at the same time when your trading multiple symbols, Quotetracker will lag by 10 seconds for each alert unless you run multiple instances of quotetracker with a different ATS perl script for each symbol sent to the extra copy of Bracket Trader. Maybe I’ll make a video tutorial on this.
Boogster,
I am working on implementing your ATS script, and I thought the MailEnable installation is really overkill for what we are doing with it. We are just looking for a simple way to get trades out of QuoteTracker and into your script, but it’s “API” is limited to SMTP.
I think I may have an answer. Have a look at SMTP Server for Developers. http://www.antix.co.uk/Projects/SMTPServerForDevelopers.aspx This free program has an SMTP receiver, but no sender or POP3 interface. It simply writes the e-mails as files into a directory. What is nice is that the program runs as User rather than as a service. It is not wasting any system resources.
The ATS script could be modified to remove the POP input code and replace it with a routine that looks for the oldest file in the mail directory, sends the command to BracketTrader, and deletes the file.
What are your thoughts?
↓ Quote | Posted March 12, 2009, 5:19 pmastut, I’m sure that we can make this ATS 10 times better in many different ways, BUT I think that you are focusing on the wrong thing; you should be focusing more on the trading system versus the ATS. If you don’t have a good trading system, then it’s not going to matter how efficient the ATS is.
↓ Quote | Posted March 12, 2009, 7:10 pmCouldn’t agree more with you Boogster. Downloaded and installed this back on Sept. 13, 2008. Has been working like a gem. Getting this up and running is the EASY problem. The HARD problem is getting a good system up and running. I believe I’m very close now to have a good system. If you want to check out the results, you or anybody else can watch it perform live at: http://www.justin.tv/newagedaytrader
Thanks again, man. You are the man.
↓ Quote | Posted March 14, 2009, 1:54 amCool. Didn’t see I could leave my url in the space above. Happy trading.
↓ Quote | Posted March 14, 2009, 1:55 amhello… i want to trade 2 symbol: YM and EUR.USD, i have duplicate bracketrader, and it’s all right…
i want trade 20.000 eur.usd but my problem is that when BT read the ats script (changed by me in : “my $DefaultEURSize=20000;”) the number is the same: “1″
again… the file Ym.txt is created, but Eur.txt not…. what is the problem?
thanks in advance
↓ Quote | Posted October 9, 2009, 11:09 amHi Boogster,
Thank you for sharing this timing saving information. Can your setup be modified for subscription email signal alerts? I get an email with stocks to buy or short and would like to setup automated trading from that email. Do you know what software/service I can look into to automate trades from email alerts?
Thanks,
↓ Quote | Posted January 20, 2010, 1:38 pmBob
you are great man!
↓ Quote | Posted March 8, 2010, 3:02 pmBoogster. Thanks again after a few years of running the automated system. Love it.
↓ Quote | Posted May 3, 2010, 1:59 pm