"PosTradeExitName" problem

Questions about MultiCharts and user contributed studies.
LMC1
Posts: 50
Joined: 28 Apr 2013
Has thanked: 29 times
Been thanked: 1 time

"PosTradeExitName" problem

Postby LMC1 » 05 May 2013

Hi,

On every new trading day, I want to check the Exit Order name of the previous day's last position.
So I code ==> if PosTradeExitName(1,0) = ("LX Eod") then .....
The whole system is then compiled and saved. But when it is run by MC, it returns error message: Division by Zero.
However, if I code it as ==> if PosTradeExitCategory(1,0) = 4 then ....
The system can be run without any problem. Unfortunately I need the first one for my purpose.

Please help.

LMC

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: "PosTradeExitName" problem

Postby Dave Masalov » 06 May 2013

Hello LMC,

We failed to reproduce the issue on our end. Please send us the code you use as well as detailed description of how to reproduce the issue.

LMC1
Posts: 50
Joined: 28 Apr 2013
Has thanked: 29 times
Been thanked: 1 time

Re: "PosTradeExitName" problem

Postby LMC1 » 07 May 2013

Hi Dave,

I'm pretty sure it is a problem of the function itself.

Only when I set the parameters as (1,0) did it return error message of {Exception} Floating-point division by zero.
When I change the parameters to whatever other combinations, such as (1,1) or (2,1).... the system compiled and saved and it works just fine.

Unfortunately, I need to set them as (1,0) since I need to check the Exit Name of the last position closed in previous day.

Can you send me the codes you used in testing this ? So I can try in my computer ?

Thanks.
LMC

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: "PosTradeExitName" problem

Postby Dave Masalov » 07 May 2013

Hello LMC,

We applied the attached signal to a CQG EPM13 10 Minute 500 Bars Back chart along with Bollinger Bands SE, Bollinger Bands LE default signals. No exceptions on our end.
Attachments
T_pten.pla
(1.12 KiB) Downloaded 469 times

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

Re: "PosTradeExitName" problem

Postby JoshM » 08 May 2013

(...)
Unfortunately, I need to set them as (1,0) since I need to check the Exit Name of the last position closed in previous day.
(...)
Doesn't PosTradeExitName(1,0) give you the exit name of the first exit order for the last position?

If you want to retrieve the exit name of the last order of the last position, you could use:

Code: Select all

PosTradeExitName(1, PosTradeCount(1) - 1);


Return to “MultiCharts”