Big Mike's Trading Blog

Day trading futures, discussing money management and trade management techniques, and more

Collective2 interface for EasyLanguage (TradeStation and MultiCharts)

I really needed a nice interface between MultiCharts (EasyLanguage, or TradeStation EasyLanguage) and Collective 2.  It seems the one written by C2 themselves is not all that great, it doesn't support profit targets or stop loss orders (OCO) or even limit orders or buy/sell stops.

So, I wrote my own.  It isn't fantastic, but at least it supports limit orders or market orders, buy and sell stops, profit targets and stop loss limits (OCO), and more.  It is a three step process:  a) function, b) signal command, c) dos command.

The signal calls the function and tells it if you want to BTO (buy to open), STO (sell to open), cover, etc, the order quantity, the instrument, and any optional parameters like the limit price, stop price, target etc.

The function builds the proper Collective2 URL query and writes it to a text file.

The DOS batch file simply loops once per second looking for the text file, then uses Wget for Windows to parse the text file and hit the embedded URL's up on the Collective2 servers.  This is where the magic happens and C2 submits your orders.

I've tested it and it works well.  I welcome feedback and enhancements.

The code itself is on the forum here:



Post a Comment

Note: Only a member of this blog may post a comment.