Auto trade tutorial

Questions about MultiCharts and user contributed studies.
capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Auto trade tutorial

Postby capgain » 26 Mar 2009

I know lot of MC users have been using auto trading with IB and hence I guess the user guide is quite sufficient. Maybe I should not even be trying auto-trading in the first place ;-) but I really wish to. I went thru the manual and I am not up to it. I know TS Multicharts folks are working on hard on next release & video tutorial but I wanted to see if they (or any expert volunteer in this newsgroup) could spend a day or two and write a good easy tutorial for auto trading for dummies. With 4-5 simple examples. I know MC plans video tutorial but I find it difficult to wait much longer.

OK, here is what I would like to do:

- connect with my current IB TWS desktop
- able to place market/limit trades both during market & afterhours
- Use a simple signal with six conditions where one buys and sells.
- find the account balance in my IB account so that auto trade can calculate appropriate trade sizes
- when cond1 happens add 1/3 position, when cond2 happens add another 1/3 and when cond3 happens, add the last third
- now when cond4 happens, sell a third, when cond5 happens, sell another third, when cond6 happens sell the final third
(of course, always check if the previous trade has been executed fully and autotrade knows what position size I am currently holding before sending in next order)
- at market close, I would like to close any existing positions

I hope I am not missing anything here.

Thanks in advance

User avatar
TJ
Posts: 7375
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2106 times

Postby TJ » 26 Mar 2009

that's a load of requirement!

you can start here:

Building Winning Trading Systems with TS
http://www.amazon.com/gp/product/047121 ... d_i=507846




if that's too difficult for you,
try this first:
http://www.amazon.com/gp/product/093438 ... d_i=507846

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 26 Mar 2009

TJ, I took a quick look and look into further. It looks more to do with easylang which is not a issue yet. I am more looking for interactions between MC(using easylang of course) and interactive broker TWS (making trades (different types), getting to know current positions and their sizes, confirmation of executions of fills, etc)

User avatar
TJ
Posts: 7375
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2106 times

Postby TJ » 26 Mar 2009

if you have an IB account, you can request a papertrading account.
(the simulated trading, not the demo system).

the papertrading account has live feed, and process orders just like the real thing.
you can test all the MC-TWS interaction through this simulated trading.


for those do not have an IB account, you can use the IB demo system. It is free.

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 26 Mar 2009

Thanks, TJ.

Also, I found a good bit of info at nearly end of the manual (pages 690-740) :shock: of the user guide (not much in the autotrading chapter itself earlier). Since MC has such powerful features, it would be great if they provide few scenarios/examples using the commands (agree it is a bit of hand holding)
Last edited by capgain on 26 Mar 2009, edited 1 time in total.

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 26 Mar 2009

I would also like to see some examples of basic systems with reccomended "safety" code for auto trading, that verifies the system is working properly and is connected to IB. I think "sync" mode should always be used but what about code to protect against unforseen connection problems etc. (code to handle reconnection, re-sync with IB etc) after the connection is lost.
I'm sure there is some standard "protection-safety code", that should be included in all autotrading systems, to assure proper sync with IB.

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 26 Mar 2009

Also, I was wondering if any here have done auto trading with multiple IB accounts (without adviser - I have 3 accounts but to do adviser, I would have to close them and then open adviser account and then add them - which is a pain and I am not a professional advisor anyway). Is it possible to connect to IB TWS clients running on different machines ?
Last edited by capgain on 26 Mar 2009, edited 1 time in total.

User avatar
TJ
Posts: 7375
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2106 times

Postby TJ » 26 Mar 2009

there is nothing like hands on...

I am a beginner in autotrade as well.

I am learning by experimenting.

there are over 150 strategies included in MC...
and ALL of them make money!
you can learn by jumping in with both feet!
(ok... some of them make money some of the time.)

scaling in/out is more advanced stuff.
it requires careful logic design and expertize coding.
it might take some time to learn and debug.



To promote synergistic learning...
I will be posting some autotrade examples here:
http://www.tssupport.com/forum/viewtopi ... 5462#25462

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 27 Mar 2009

there is nothing like hands on...

...
To promote synergistic learning...
I will be posting some autotrade examples here:
http://www.tssupport.com/forum/viewtopi ... 5462#25462
TJ,

the approach I am taking so far is this. I had written a dll which takes input from various indicators from various charts and comes up with magic formula :lol: . I am extending that DLL to include all the bookkeeping of trades, scaling in/out, etc. So the signal and this DLL work together to do the auto-trades. The signal basically just creates and sends in the orders to IB. This has been my quickest way especially since I am more C++ than easylang (I gave up on easylang when I started to search on way to read from a file!). Anyway, in the one hour or two I tried this, it appears OK (I have other issues which I will write about in another message) - but you can tell about my confidence based on the fact that I am doing autotrading in huge 1 share lots.

User avatar
TJ
Posts: 7375
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2106 times

Postby TJ » 27 Mar 2009

TJ,

the approach I am taking so far is this. I had written a dll which takes input from various indicators from various charts and comes up with magic formula :lol: . I am extending that DLL to include all the bookkeeping of trades, scaling in/out, etc. So the signal and this DLL work together to do the auto-trades. The signal basically just creates and sends in the orders to IB. This has been my quickest way especially since I am more C++ than easylang (I gave up on easylang when I started to search on way to read from a file!). Anyway, in the one hour or two I tried this, it appears OK (I have other issues which I will write about in another message) - but you can tell about my confidence based on the fact that I am doing autotrading in huge 1 share lots.
that's great. Maybe you can share with us how to use dll?
I have downloaded the GV, ADE, etc., but still haven't made any headway with them.

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 29 Mar 2009


that's great. Maybe you can share with us how to use dll?
I have downloaded the GV, ADE, etc., but still haven't made any headway with them.
I don't know about GV, ADE .. When you mention how to use dll, do you mean how Multicharts works with any user-developed DLL ?

User avatar
TJ
Posts: 7375
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2106 times

Postby TJ » 29 Mar 2009

I don't know about GV, ADE .. When you mention how to use dll, do you mean how Multicharts works with any user-developed DLL ?
anything you can share with us is a bonus.

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 03 Apr 2009

I don't know about GV, ADE .. When you mention how to use dll, do you mean how Multicharts works with any user-developed DLL ?
anything you can share with us is a bonus.
TJ, I have sent you a simple dll project by PM. Please tell if you got it ..

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Re: Auto trade tutorial

Postby capgain » 03 Apr 2009

Do these functions work (i am using Multicharts with IB) ..
GetAccountID
GetRTAccountNetWorth
GetPositionQuantity

In my signal compilation, it complains about "unknown function". I would appreciate any help on this. Thanks!

SUPER
Posts: 633
Joined: 03 Mar 2007
Has thanked: 105 times
Been thanked: 81 times

Re: Auto trade tutorial

Postby SUPER » 04 Apr 2009

Do these functions work (i am using Multicharts with IB) ..
GetAccountID
GetRTAccountNetWorth
GetPositionQuantity

In my signal compilation, it complains about "unknown function". I would appreciate any help on this. Thanks!
No they are not supported as yet, at present we can not get any information from IB into multichart through powerlanguage functionality. I sincerely hope they become available soon.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 04 Apr 2009

FYI:
We are working on a broker's market position keyword.
We are adding two reserved words:
MarketPosition_at_Broker;
MarketPosition_at_Broker_for_The_Strategy;

It will be available in MC 5.1

All existing users are entitled for minor upgrades after MultiCharts 5.0 (Gold) release.

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 04 Apr 2009

Andrew, don't you mean v6.1 ? (for the new broker position functions )

User avatar
TJ
Posts: 7375
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2106 times

Postby TJ » 04 Apr 2009

FYI:
We are working on a broker's market position keyword.
We are adding two reserved words:
MarketPosition_at_Broker;
MarketPosition_at_Broker_for_The_Strategy;

It will be available in MC 5.1
All existing users are entitled for minor upgrades after MultiCharts 5.0 (Gold) release.
:D :D :D :D :D

say goodbye to the competition !

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times
Contact:

Postby Andrew Kirillov » 07 Apr 2009

:)
No, I mean 5.1. As soon as we release the Gold version we will roll out the 5.1 beta with many small but very important things.

capgain
Posts: 63
Joined: 14 Apr 2008
Been thanked: 3 times

Postby capgain » 12 Apr 2009

:)
No, I mean 5.1. As soon as we release the Gold version we will roll out the 5.1 beta with many small but very important things.
Is there a list of brokers (other than IB) that Multicharts (current and Gold version) integrates with that allows for auto-trading


Return to “MultiCharts”