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
"PosTradeExitName" problem
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: "PosTradeExitName" problem
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.
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.
Re: "PosTradeExitName" problem
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
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
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: "PosTradeExitName" problem
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.
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 476 times
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: "PosTradeExitName" problem
Doesn't PosTradeExitName(1,0) give you the exit name of the first exit order for the last position?(...)
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.
(...)
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);