AutoTrade Questions

Questions about MultiCharts and user contributed studies.
rondot samuel ws
Posts: 103
Joined: 05 Sep 2007
Has thanked: 8 times
Been thanked: 6 times

AutoTrade Questions

Postby rondot samuel ws » 29 Apr 2011

[moderator's note: this thread is a split from another so that the questions can be addressed with more focus]


Hi,

I'm totally agree with that. Autotrading in MC need really to be improve.

We have to developed softwares to check in realtime marketposition vs marketpositionatBroker and alert in case of difference.
Log in MC are binary,
https://www.multicharts.com/pm/viewissu ... e_no=MC-94
so no way for check them.

No true alerte,
https://www.multicharts.com/pm/viewissu ... _no=MC-260
for example :
If you send a market order and for any reason quantity filled = 0 (yes It should arrive even when market is open !!!) there is only an information line (not warning or error) in "order and position tracker" logs tabs.

I'm post some problem I had:
https://www.multicharts.com/pm/viewissu ... _no=MC-109
https://www.multicharts.com/pm/viewissu ... _no=MC-123
https://www.multicharts.com/pm/viewissu ... _no=MC-224

The answer was "it's not a bug". Well why not, but it's problem I have only with MC. Not with NT with IB and not with MT4 (what I used previously)

I'm using AA mode because if I use SA, it seems I can have troubble.
I made tests about 1 year ago, and was not satisfied by SA mode. May be now it's different. Or maybe I made a mistake
I have 75 workspaces and I trade on 10 differents symbols. (not 75 * 10 )
If for any reason i have to switch off MC, or crash or server problem or reboot:
When I switch on SA again, he forget he is already in position.
So my current position are not exact.
or I have to know exactly for each strategy , the exact position, the entry price and fill it then I switch on to SA ?
so hard work and unrealistic ....

or may be it's exist an other solution ?

Your reply will be really appreciate


Laurent
Last edited by rondot samuel ws on 02 May 2011, edited 1 time in total.

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: AutoTrade Questions

Postby Stan Bokov » 03 May 2011

Hi,

I'm totally agree with that. Autotrading in MC need really to be improve.
Dear Laurent,

Thank you for your questions. This may be a somewhat long post, you mentioned many points, and I will try to analyze each point you made, so that we can investigate what's going on. I re-read your post several times, and I will try to establish what you are trying to achieve, and then suggest ways to get there. I may not get it 100% right on the first try, so please correct me where needed.
We have to developed softwares to check in realtime marketposition vs marketpositionatBroker and alert in case of difference.
This seems to be related to the question about Synchronous Autotrading (SA) mode vs Asynchronous Autotrading (AA) mode. I will address this lower. Note: the difference is documented in the Help file pretty extensively, but I will try to explain the main differences.
Log in MC are binary,
https://www.multicharts.com/pm/viewissu ... e_no=MC-94
so no way for check them.
Based on my observations, this is a feature request for having Order and Position Tracker logs saved to a text file.
You can check the autotrading logs in the general Logs folder for MultiCharts. Every communication of MultiCharts with the outside world is recorded there. I must admit, they are not very easy to read, but the info is there. You can also see what happened directly through the Order and Position Tracker. In conclusion, your suggestion for improved logs has been noted and we will try to work that improvement into our roadmap.
No true alerte, https://www.multicharts.com/pm/viewissu ... _no=MC-260
for example :
If you send a market order and for any reason quantity filled = 0 (yes It should arrive even when market is open !!!) there is only an information line (not warning or error) in "order and position tracker" logs tabs.
Based on my observations, this is a feature request for having Visual and Email alerts for orders filled or unfilled. Currently there is a text alert in the Order and Position Tracker, and there is an option to have audio alerts played when orders are sent (no difference if it was filled, rejected, or unfilled). What some people do is create an indicator that draws vidual lines and triggers at exactly the same time, and they use the alerts available for indicators to produce visual and email alerts. In my personal opinion, the alerts in signals can be improved, so your feature is warranted. Once again, your suggestion for improved alerts for signals has been noted and we will try to work that improvement into our roadmap.

Now, let's analyze these issues one by one.
1. https://www.multicharts.com/pm/viewissu ... _no=MC-109 - from what it appears to me, IB's API will reject one of the two orders if you attempt to purchase the same security in both long and short directions at the same time. At that time, the message "Cross Order" will appear in the Order and Position Tracker, it's a message generated by IB and sent through the API. This is a limitation of Interactive Brokers, so there is nothing we can do about this. The question, as I looked through the comments, seems to be this - the alerts in the Order and Position Tracker are not good enough. What you would like to see is an improvement to the alert system when you get such a message. This loops back to the Alert system for signals (which make strategies) that I mentioned above, and monitoring the status of each order so that the appropriate alert can be displayed. Your suggestion for improved alerts for signals has been noted and we will try to work that improvement into our roadmap.

Alternatively, you can try NOT to send cross orders, (I assume this happens because you are trading the same symbol from different charts with different strategies). You can help the situation by combining your strategies, or even into the same signal, and building conditions in such a way that cross orders will not be sent at the same time.

2. https://www.multicharts.com/pm/viewissu ... _no=MC-123 - here you it appears that you saw an order on your chart, but it did not fill. You have a valid question - why?

It appears from the comments that you were using AA mode, and this issue deals with the way AA and SA differ. AA mode, will display all historical simulated (backtested) trades on the chart once you turn real autotrading on. Also, it will display an arrow on the chart when an order was GENERATED by the script, REGARDLESS of whether it was filled at the broker. The AA mode doesn't care what happens at the broker, if it was made, it's on the chart.

SA mode is rather different - it will show ONLY trades that actually HAPPENED at the broker. When you turn on autotrading, all historical simulated (backtested) trades will be removed from the chart because they never happened at the broker. An arrow on the chart will only be drawn after a confirmation has been received from the broker that an order has been executed. If it was rejected for whatever reason, you will not see anything on your chart.

Each mode has its strengths and weaknesses. You can choose either AA or SA, depending on what you want to guarantee - synchronization or seeing all generated orders.

How this applies to you - you indicated (lower) that you want AA because SA 'forgets' it's in a position after a disconnect-reconnect. Here is how to use SA and address that - in the Strategy Properties window > Autotrading tab there is a section called Assign Initial Market Position. Check the tick box called Show Always (attached screenshot)

How to use AA and stay synchronized most of the time with market orders (improve your chances). Aside from rejections by the broker as in this case (nothing we can do about), it's possible that your market order will not get filled for other reasons (however unlikely, its possible). I'm not saying "buy next bar market" doesn't work, or works poorly, but there is yet another way to place market orders quickly with MultiCharts. These words are almost like Easter eggs, because the documentation is still being drafted for them. The keywords are PlaceMarketOrder and ChangeMarketPosition. PlaceMarketOrder is unique because it sends a market order OUTSIDE of the autotrading module, by-passing any possible lag, order queues, etc. It's meant for one thing only, to place a market order asap. Since it goes outside of the module, it will not be recorded in the Position Tracker, or anywhere in the program (except the logs), it doesn't change your market position on the chart, but it will show up at the broker. So, the upside is - gets there quickly, downside - doesn't change market position, so doesn't affect your strategy. This is 1/2 equation.

Second 1/2 of the equation is the ChangeMarketPosition keyword. It will draw an arrow on the chart at the specified price, it will artificially change the market position on the chart, and it will be recorded AS IF it sent an order, but it doesn't actually send anything.

If you use the two keywords together, you have a nice combination of sending market orders and keeping track of them.

3. https://www.multicharts.com/pm/viewissu ... _no=MC-224 - this report seems to show another situation where you have asynchronization between your chart and your broker, while using AA mode. This is expected, and what I explained above should help.
The answer was "it's not a bug". Well why not, but it's problem I have only with MC. Not with NT with IB and not with MT4 (what I used previously)
The difference in your user experience, I think, comes from understanding the features more fully in NT and in MT4, and not in MC. Our documentation is not perfect, and a little on the short side, it must be admitted.
I'm using AA mode because if I use SA, it seems I can have troubble.
I made tests about 1 year ago, and was not satisfied by SA mode. May be now it's different. Or maybe I made a mistake
I have 75 workspaces and I trade on 10 differents symbols. (not 75 * 10 )
If for any reason i have to switch off MC, or crash or server problem or reboot:
When I switch on SA again, he forget he is already in position.
So my current position are not exact.
or I have to know exactly for each strategy , the exact position, the entry price and fill it then I switch on to SA ?
so hard work and unrealistic ....

or may be it's exist an other solution ?

Your reply will be really appreciate
In conclusion, I believe the answers you were looking for are included above. I included them there, because it seemed like a better fit for a logical flow of the explanation. If you have any questions/correction, please let me know.
Attachments
assign_mkt_position.png
(59.64 KiB) Downloaded 599 times

rondot samuel ws
Posts: 103
Joined: 05 Sep 2007
Has thanked: 8 times
Been thanked: 6 times

Re: AutoTrade Questions

Postby rondot samuel ws » 05 May 2011

Hi,

Many thanks for your reply. I really appreciate it. well documented and complete.
A good support from MC team !!!

I just keep main focus for better reading.
Log in MC are binary /Order and Position Tracker
When you have many workspaces, with order every 15" , reading log text can be a nightmare.
Could you please just add sort and filter in Order and Position Tracker on column (date/time, instrument, workspace) ?
Alerte
Based on my observations, this is a feature request for having Visual and Email alerts for orders filled or unfilled. Currently there is a text alert in the Order and Position Tracker, and there is an option to have audio alerts played when orders are sent (no difference if it was filled, rejected, or unfilled). What some people do is create an indicator that draws vidual lines and triggers at exactly the same time, and they use the alerts available for indicators to produce visual and email alerts. In my personal opinion, the alerts in signals can be improved, so your feature is warranted. Once again, your suggestion for improved alerts for signals has been noted and we will try to work that improvement into our roadmap.
audio alert for order send: not good when you have MC on a server (no remote sound) and/or more than 50 workspace with market/limit/stop order every 15".

create an indicator that draws visual lines and triggers at exactly the same time, and they use the alerts available for indicators to produce visual and email alerts : with limit and stop order it's not usefull
Cross Order
not easy to prevent with sometimes 20 strategy on the same symbol and different time frame.
Really no way for MC to detect cross order and send again the order ?
AA vs SA
You add "assume the initial MP at broker same as chart" feature after I made test and we choose AA.
May be this feature resolve our problem. We will test it on few workspace and check.

We will make test with "PlaceMarketOrder and ChangeMarketPosition" : should not be usefull for us : In fact we have only few strategy with Marketorder. most of them use limit / stop.

but "ChangeMarketPosition" should be an amazing solution for money management for have fake order and be off market in real and on market in forward test.
If only it can exist for limit/stop order :)


Once again, thank you for your reply.

Laurent

rondot samuel ws
Posts: 103
Joined: 05 Sep 2007
Has thanked: 8 times
Been thanked: 6 times

Re: AutoTrade Questions

Postby rondot samuel ws » 23 May 2011

Hi,
AA vs SA
You add "assume the initial MP at broker same as chart" feature after I made test and we choose AA.
May be this feature resolve our problem. We will test it on few workspace and check.

Laurent
Unfortunatly "assume the initial MP at broker same as chart" doesn't work with SA, so the problem is not solved at all.


Return to “MultiCharts”