MarketPosition_at_Broker vs MarketPosition

Questions about MultiCharts and user contributed studies.
tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

MarketPosition_at_Broker vs MarketPosition

Postby tradingest » 16 May 2016

Hi all,

what is the difference between MarketPosition_at_Broker and MarketPosition?
When use one or the other.

Thanks,
tradingest

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby TJ » 16 May 2016

Hi all,

what is the difference between MarketPosition_at_Broker and MarketPosition?
When use one or the other.

Thanks,
tradingest
Have you checked the wiki?

Have you read the examples?

Which part do you not understand?

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby tradingest » 16 May 2016

I not undertand the difference.
I am not clear and I would like a different explanation if possible.

tony
Posts: 420
Joined: 14 Jun 2013
Has thanked: 30 times
Been thanked: 81 times
Contact:

Re: MarketPosition_at_Broker vs MarketPosition

Postby tony » 16 May 2016

MP at Broker checks your position at broker, used for live versus MP does not check broker position and is used for backtesting.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby Henry MultiСharts » 16 May 2016

MarketPosition_at_Broker - number of contracts and the type of position at the broker for the symbol.
MarketPosition_at_Broker_for_the_Strategy - number of contracts and the type of position at the broker for the strategy (MC auto-trading engine position).
MarketPosition - current strategy type of position on a given chart.

For more information please refer to our wiki section:
https://www.multicharts.com/trading-sof ... _at_Broker
https://www.multicharts.com/trading-sof ... e_Strategy
https://www.multicharts.com/trading-sof ... etPosition

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby tradingest » 16 May 2016

Ok now it's clear.

If I use the code below only to close the position that option I must set?
The position entry is manually from mobile and the manage position is through code

Code: Select all

if MarketPosition_at_Broker <> 0
then begin
setstoploss(10);
setprofittarget(15);
End;
Image


Thanks,
tradingest
Attachments
Immagine 016.png
(8.94 KiB) Downloaded 1769 times

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby tradingest » 18 May 2016

somebody can you help me on this question?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby Henry MultiСharts » 18 May 2016

The code you have posted above will not work as you expect it, it is not complete for the broker to strategy synchronization. There is a prebuilt signal that comes with the platform to achieve this goal. Please study the reply I have already provided in your other thread: viewtopic.php?f=1&t=49727

tradingest
Posts: 283
Joined: 05 Dec 2014
Location: Italy
Has thanked: 53 times
Been thanked: 3 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby tradingest » 19 May 2016

Hi Henry,

I read your advise but I can't find the solution on my problem.
I have set the option like show below but when I open the position from mobile the strategy don't active the order stop and takeprofit.

Why? What I wrong?

Image

Thanks,
tradingest
Attachments
Immagine 019.png
(28.57 KiB) Downloaded 1757 times

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: MarketPosition_at_Broker vs MarketPosition

Postby Henry MultiСharts » 20 May 2016

tradingest, please see my reply above.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: MarketPosition_at_Broker vs MarketPosition

Postby JoshM » 28 May 2016

I read your advise but I can't find the solution on my problem.
I have set the option like show below but when I open the position from mobile the strategy don't active the order stop and takeprofit.

Why? What I wrong?
tradingest, please see my reply above.
Tradingest, what Henry points to here is that your code:

Code: Select all

if MarketPosition_at_Broker <> 0
then begin
setstoploss(10);
setprofittarget(15);
End;
Doesn't do anything in order to have MultiCharts manage the position that's currently open at the broker. Instead, what this code does is to check whether there's an open position at the broker (`MarketPosition_At_Broker <> 0`), and then submits a stop-loss of 10 base currency and a profit target of 15 base currency.

However, at that point the MultiCharts strategy doesn't "taken ownership of" the open market position at the broker: your strategy at that point still think it's flat.

To 'give' the strategy a market position, you'll need to use the ChangeMarketPosition() keyword. With that keyword you can "tell" MultiCharts that there is an open position, and then the signal can manage the position for you.


Return to “MultiCharts”