Thanks Marina,
A good solution, I'm not concerned about losing connection to my data provider because my data provider is TS which I've set up to email me if data stops. The only problem is (as you say) this alert could lag by the length of a bar, and a lot can happen in the space of a bar!
I've done some more work on this and according to my testing, a connection on TCP port 7496 is established when MC-IB autotrading is enabled. So I can monitor that and send an email within a few seconds of disconnection.
PS, a small request, please can you add shortcut keys for the Close Position, and Do Not Close Position buttons in the Auto Trading Warning window that is displayed when you disable autotrading while in a position. Many autotraders automate the interface using macros and scripts, and shortcut keys for buttons and menu options (denoted by an underscored character) make these much more robust, so they are very important. I'm sure those who have difficulty using a mouse will appreciate the easier accessibility too.
Many thanks again.
How to detect whether autotrading is enabled?
-
- Posts: 103
- Joined: 05 Sep 2007
- Has thanked: 8 times
- Been thanked: 6 times
Hi,
I looking for a solution for check MC and autotrading in Real time along the day.
The idea is to check GetAppInfo() and the positions, check position signal side and broker side etc.
The solution describe below is not good enough because the information is update only at the end of the bar. and with 240 mn bar...
Is it possible to update GetappInfo() at begin of bar for have info at the begin of day for example?
I try differents solutions for obtain information more frequently that end of bar.
// IOG solution ?
IOG = true and send order only if barstatus = 0 : i dont have the same orders in the chart in the previous days.
IOG = true and send order only if barstatus = 1 : i dont have the same orders in the chart in the previous days.
// Chart 1 mn
I put a chart in 1 mn and kept the original chart.
The idea is to calculate signal on the original chart and update info to personal log file in the 1 mn chart.
Unfortunatly, it doesn't work, the signal is not run each mn on the 1 mn chart.
So do you have any idea ?
Thanks
Samuel
I looking for a solution for check MC and autotrading in Real time along the day.
The idea is to check GetAppInfo() and the positions, check position signal side and broker side etc.
The solution describe below is not good enough because the information is update only at the end of the bar. and with 240 mn bar...
Is it possible to update GetappInfo() at begin of bar for have info at the begin of day for example?
I try differents solutions for obtain information more frequently that end of bar.
// IOG solution ?
IOG = true and send order only if barstatus = 0 : i dont have the same orders in the chart in the previous days.
IOG = true and send order only if barstatus = 1 : i dont have the same orders in the chart in the previous days.
// Chart 1 mn
I put a chart in 1 mn and kept the original chart.
The idea is to calculate signal on the original chart and update info to personal log file in the 1 mn chart.
Unfortunatly, it doesn't work, the signal is not run each mn on the 1 mn chart.
So do you have any idea ?
Thanks
Samuel
-
- Posts: 103
- Joined: 05 Sep 2007
- Has thanked: 8 times
- Been thanked: 6 times
Hi
IOG = Intrabar Order
I wrote i my post :
// IOG solution ?
IOG = true and send order only if barstatus = 0 : i dont have the same orders in the chart in the previous days.
IOG = true and send order only if barstatus = 1 : i dont have the same orders in the chart in the previous days.
So it doesn't work, because i don't have the same order. I want order are send only at end of bar. and even if i use barstatus = 0 or 1 then i don't have the same orders than if i don't use IOG
IOG = Intrabar Order
I wrote i my post :
// IOG solution ?
IOG = true and send order only if barstatus = 0 : i dont have the same orders in the chart in the previous days.
IOG = true and send order only if barstatus = 1 : i dont have the same orders in the chart in the previous days.
So it doesn't work, because i don't have the same order. I want order are send only at end of bar. and even if i use barstatus = 0 or 1 then i don't have the same orders than if i don't use IOG
Hi,
with the chart, you can have intrabar update, so why not using GetAppInfo on each tic instead of each bar ?![]()
Like that , the length of the bar doesn't mater
Hi rondot
I think I see your point, and I have the solution :
You want to use the intra bar to use GetAppInfo
but you want to send the order only if a new bar appear . Here is the solution I use :
1/ you turn on the intrabar
2/ add in your strategy :
Variable: IntrabarPersist LastDateTime("");
if LastDateTime<>numtostr(TIME,0) then begin
HERE YOU PUT YOUR ORDER
end
else begin
HERE YOU USE GetAppInfo
END;
LastDateTime=numtostr(TIME,0);
Like that only GetAppInfo will be called during the intrabar
I hope this will help you
I think I see your point, and I have the solution :
You want to use the intra bar to use GetAppInfo
but you want to send the order only if a new bar appear . Here is the solution I use :
1/ you turn on the intrabar
2/ add in your strategy :
Variable: IntrabarPersist LastDateTime("");
if LastDateTime<>numtostr(TIME,0) then begin
HERE YOU PUT YOUR ORDER
end
else begin
HERE YOU USE GetAppInfo
END;
LastDateTime=numtostr(TIME,0);
Like that only GetAppInfo will be called during the intrabar

I hope this will help you
-
- Posts: 261
- Joined: 28 Feb 2008
- Has thanked: 2 times
- Been thanked: 1 time
Hi,
From time to time I may loose Autotrader connection with IB. usually this happen after midnight, I agree this is a problem.
From time to time, some order are a sell instead of a buy and vis versa, this is as well a problem .
But, MC is improving constantly and I know that TSSupport are working on those 2 bugs actually.
I am sure TSSupport will get rid of those 2 bug soon.
Emmanuel
From time to time I may loose Autotrader connection with IB. usually this happen after midnight, I agree this is a problem.
From time to time, some order are a sell instead of a buy and vis versa, this is as well a problem .
But, MC is improving constantly and I know that TSSupport are working on those 2 bugs actually.
I am sure TSSupport will get rid of those 2 bug soon.

Emmanuel
- TJ
- Posts: 7675
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1018 times
- Been thanked: 2202 times
I am not sure if that is a MultiCharts problem...Hi,
From time to time I may loose Autotrader connection with IB. usually this happen after midnight, I agree this is a problem.
From time to time, some order are a sell instead of a buy and vis versa, this is as well a problem .
But, MC is improving constantly and I know that TSSupport are working on those 2 bugs actually.
I am sure TSSupport will get rid of those 2 bug soon.![]()
Emmanuel
GIGO... MC can only do what you have programmed it to do.
ps. with the way I trade... that's not a bad idea, I might make some money with such a feature. LOL

Hi Tj,
I know this may seem strange, it may sell instead of buying and vis versa
In Multichart, the program work always fine : a buy in powerlanguage is a buy on the chart, and a sell is always a sell on the chart.
But unfortunatly, sometime a communication problem appear between Multichart and IB, Multichart buy , and a sell appear on the broker interface.
This is rare.
I know this may seem strange, it may sell instead of buying and vis versa
In Multichart, the program work always fine : a buy in powerlanguage is a buy on the chart, and a sell is always a sell on the chart.
But unfortunatly, sometime a communication problem appear between Multichart and IB, Multichart buy , and a sell appear on the broker interface.
This is rare.
- TJ
- Posts: 7675
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1018 times
- Been thanked: 2202 times
You can always trace your orders in MC and match them with the log in TWS.Hi Tj,
I know this may seem strange, it may sell instead of buying and vis versa
In Multichart, the program work always fine : a buy in powerlanguage is a buy on the chart, and a sell is always a sell on the chart.
But unfortunatly, sometime a communication problem appear between Multichart and IB, Multichart buy , and a sell appear on the broker interface.
This is rare.
Nothing can go astray without an audit trail.
This is a serious allegation.
If there is a problem as you claimed,
I don't think MultiCharts will take it lightly;
you should forward the logs to Tech Support
and I am sure an expert would be happy to match them for you.
-
- Posts: 103
- Joined: 05 Sep 2007
- Has thanked: 8 times
- Been thanked: 6 times
Hi Emmanuel,
Many thanks for your help.
unfortunatly, i don't obtain the same result in near old order with your code and OIG = true.
Have a good day
Many thanks for your help.
unfortunatly, i don't obtain the same result in near old order with your code and OIG = true.
Have a good day
Hi rondot
I think I see your point, and I have the solution :
You want to use the intra bar to use GetAppInfo
but you want to send the order only if a new bar appear . Here is the solution I use :
1/ you turn on the intrabar
2/ add in your strategy :
Variable: IntrabarPersist LastDateTime("");
if LastDateTime<>numtostr(TIME,0) then begin
HERE YOU PUT YOUR ORDER
end
else begin
HERE YOU USE GetAppInfo
END;
LastDateTime=numtostr(TIME,0);
Like that only GetAppInfo will be called during the intrabar![]()
I hope this will help you
-
- Posts: 103
- Joined: 05 Sep 2007
- Has thanked: 8 times
- Been thanked: 6 times
Thanks for your reply.
please find attach 2 copy screens
only 1 trade with iog=true
please find attach 2 copy screens
only 1 trade with iog=true
- Attachments
-
- MC-AllTrades.jpg
- Signal with all trades. No intrabar
- (147.36 KiB) Downloaded 2098 times
-
- MC-IntrabaOrder.jpg
- Signal with intrabarorder true. only 1 trade
- (145.99 KiB) Downloaded 2110 times
- TJ
- Posts: 7675
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1018 times
- Been thanked: 2202 times
-
- Posts: 103
- Joined: 05 Sep 2007
- Has thanked: 8 times
- Been thanked: 6 times