Access to MarketPosition when MANUAL trading

Questions about MultiCharts and user contributed studies.
Nicolas23
Posts: 50
Joined: 13 Oct 2011
Has thanked: 22 times
Been thanked: 35 times

Access to MarketPosition when MANUAL trading

Postby Nicolas23 » 13 Feb 2012

Hi,

I am performing manual (discretionary) trading with MultiCharts, coupled with Interactive Brokers.

I would like to follow what my trading, in order to perform some statistics.
In this purpose, I am trying to write an indicator or a signal, which would run in parallel of my discretionary trading, and perform some analysis.
However, MarketPosition does not seem to work when in manual trading (= when the trading is not generated by signals).
For instance, I have used this simple signal code:

Code: Select all

[IntrabarOrderGeneration = false]

If LastBarOnChart then begin
   MessageLog("");
   MessageLog("MarketPosition = ", MarketPosition);
   MessageLog("MarketPosition_at_Broker = ", MarketPosition_at_Broker);
   MessageLog("MarketPosition_at_Broker_for_the_Strategy = ", MarketPosition_at_Broker_for_the_Strategy); 
end;

When I buy, sell, etc. manually, all the above MarketPosition variables continue to tell "0" and do not reflect the actual trading.

Do you know a way to have access to MarketPosition when performing manual trading, that is to say when buy/sell orders are not generated by signals, but by the trader?

Thanks in advance for your help! :)
Best regards,

Nicolas

User avatar
Henry MultiСharts
Posts: 8479
Joined: 25 Aug 2011
Has thanked: 1211 times
Been thanked: 2719 times

Re: Access to MarketPosition when MANUAL trading

Postby Henry MultiСharts » 14 Feb 2012

Hello Nicolas,

Here is what I can recommend.
1) Use i_MarketPosition_at_Broker in the indicator.
Using this word in your script will return the same market position that you can see on the Manual trading panel. It will work only if the auto trading is enabled. Add a dummy signal and turn on Auto trading to make it work.

2) Write a signal that will check the market position at broker.
Add the signal !From Broker To Strategy MP Synchronizer! to the chart.
Turn on the Auto trading.
Then trade manually from the Manual trading panel.
The orders on the chart would be dubbed, as they will be synchronized with the broker (but at the broker there will be only the orders placed manually). You can disable "Historical orders" in Format->Chart trading.
These users thanked the author Henry MultiСharts for the post (total 2):
JoshMStan Bokov

Nicolas23
Posts: 50
Joined: 13 Oct 2011
Has thanked: 22 times
Been thanked: 35 times

Re: Access to MarketPosition when MANUAL trading

Postby Nicolas23 » 14 Feb 2012

Thanks to your answer, my problem is solved. Thanks a lot!

Nicolas


Return to “MultiCharts”