question about the exit

Questions about MultiCharts and user contributed studies.
steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

question about the exit

Postby steven » 28 Sep 2010

When I have 2 long positions, $100 loss for the first one and $200 loss for the second one, how can I close the second one firstly and hold the first one still?

User avatar
Anastassia
Posts: 179
Joined: 18 Jan 2010
Been thanked: 4 times

Re: question about the exit

Postby Anastassia » 28 Sep 2010

Hi Steven,
When I have 2 long positions..
If there are two different symbols, you won't have any problems at all. Positions for those two symbols won't intersect so you can simply trade from two charts.
If symbols are the same then the position at Broker for this symbol is joined. If that is the case, the question is not very clear to us. Please explain it in detail.

Thank you in advance

steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

Re: question about the exit

Postby steven » 28 Sep 2010

Hi Anastassia,

Same symbol and the pyramiding was turned on, So I can buy 2 contracts at the different entry price, after a while, I found the first contract had a loss of $200 and the $100 for the second one, So I want to close the first contract firstly and hold the second contract.

The question is:
How can I get the contract with $200 loss? I know the keyword "entryname" can be used in MC6, Could you show me the way?

Thanks
Steven

steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

Re: question about the exit

Postby steven » 28 Sep 2010

I found the below new feature of MC6, Can this be help?

"If pyramiding is enabled and several simulated entries are made before Autotrading is turned on, software now takes them into consideration as separate entries and is able to use "exit from entry" logic in asynchronous Autotrading mode on those entries."

User avatar
Anastassia
Posts: 179
Joined: 18 Jan 2010
Been thanked: 4 times

Re: question about the exit

Postby Anastassia » 29 Sep 2010

Hi Steven,

Below is the example demonstrating an exit from the specific entry.

Code: Select all

Inputs: STime(310);

if currentbar > 1 and marketposition = 0 and time > STime then
begin
Buy("Break Up") next bar at market;
end;

If Marketposition > 0 then
begin
Sell("Long Stop") from entry ("Break Up") next bar at market;
end;
Thank you

steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

Re: question about the exit

Postby steven » 06 Oct 2010

Dear Anastassia,

If there are 2 entries called "break up1" and "break up2" entered in different time, How can I get the entry name of the one which got a more loss?

Thanks,
Steven

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Re: question about the exit

Postby SUPER » 06 Oct 2010

You can use "Positionprofit" to distinguish between your position,

for example

Code: Select all

If Marketposition > 0 and PositionProfit =-200 then
begin
Sell("Long Stop1") from entry ("Break Up1") next bar at market;
end;

If Marketposition > 0 and PositionProfit =-100 then
begin
Sell("Long Stop2") from entry ("Break Up2") next bar at market;
end;

User avatar
Anastassia
Posts: 179
Joined: 18 Jan 2010
Been thanked: 4 times

Re: question about the exit

Postby Anastassia » 11 Oct 2010

Hi Steven,
How can I get the entry name of the one which got a more loss?
There is no way to get the name of the entry with the greater loss however you can get the number of the entry by comparing profits. Use OpenEntryProfit keyword.

Thank you


Return to “MultiCharts”