Problems with Strategy Position Trade Reserved Words

Questions about MultiCharts and user contributed studies.
User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Problems with Strategy Position Trade Reserved Words

Postby ABC » 08 Aug 2012

Just stumpled upon something that doesn't make sense to me.
Using a very simple strategy with this code:

Code: Select all

Variables:
ii (0);

once
begin
for ii = 0 to 4
begin
Print("ii: ", ii, "; PosTradeIsOpen(0, ii): ", PosTradeIsOpen(0, ii));
Print("ii: ", ii, "; PosTradeIsLong(0, ii): ", PosTradeIsLong(0, ii));
end;
end;
The print output is:
ii: 0.00; PosTradeIsOpen(0, ii): TRUE
ii: 0.00; PosTradeIsLong(0, ii): TRUE
ii: 1.00; PosTradeIsOpen(0, ii): TRUE
ii: 1.00; PosTradeIsLong(0, ii): TRUE
ii: 2.00; PosTradeIsOpen(0, ii): TRUE
ii: 2.00; PosTradeIsLong(0, ii): TRUE
ii: 3.00; PosTradeIsOpen(0, ii): TRUE
ii: 3.00; PosTradeIsLong(0, ii): TRUE
ii: 4.00; PosTradeIsOpen(0, ii): TRUE
ii: 4.00; PosTradeIsLong(0, ii): TRUE
Why does PosTradeIsOpen return "true", if there are no open positions? Same goes for PosTradeIsLong. I can understand that it has to return something, but according to the help file it "Returns True value if the trade was opened by buy order, otherwise False value is returned.". So in my opinion either the help needs to be updated or it should return false.
For PosTradeIsOpen returning "true" for not existing positions is wrong and problematic in my opinion, as you will run into problems this way.
I noticed this in MultiCharts Version 8.0 Release (Build 5620) and didn't check the 64 bit version.

Regards,

ABC

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

Re: Problems with Strategy Position Trade Reserved Words

Postby Henry MultiСharts » 09 Aug 2012

Hello ABC,

We'll check that.

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

Re: Problems with Strategy Position Trade Reserved Words

Postby Dave Masalov » 10 Aug 2012

ABC,

The issue has been confirmed and will be addressed in the next version. Thank you for reporting.


Return to “MultiCharts”