Got an error "STD exception: invalid argument"  [SOLVED]

Questions about MultiCharts and user contributed studies.
lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Got an error "STD exception: invalid argument"

Postby lois77 » 10 Sep 2012

Hi,

After adding the following code:

Code: Select all

condition3 = PosTradeEntryName(1,PosTradeCount(1)) <> "XXXXXXXXXXXX" ;


I got this message "STD exception: invalid argument".

What is the problem with it?

Kind regards.

User avatar
Henry MultiСharts
Posts: 8520
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2741 times

Re: Got an error "STD exception: invalid argument"  [SOLVED]

Postby Henry MultiСharts » 11 Sep 2012

Hello lois77,

Please try this code:

Code: Select all

once cleardebug;

var: TC(0);

TC = PosTradeCount(0);
print("TC = ", TC, " Currentbar = ", currentbar);

if(tc > 1) then
begin
   TC = PosTradeCount(1);
   print(" - TC = ", TC, " Currentbar = ", currentbar);
   print("PositionName = ", PosTradeEntryName(1, TC));
end
These users thanked the author Henry MultiСharts for the post:
lois77

lois77
Posts: 23
Joined: 05 Aug 2012
Has thanked: 7 times

Re: Got an error "STD exception: invalid argument"

Postby lois77 » 11 Sep 2012

Hey Henry,

You rule!!
It worked.
This functions are so important to simplify the code and to maximize the strategy.

Just one more question, the "once cleardebug;" instruction should be placed in the beginning of the signal or is it irrelevant?

Thank you very much for the help.

Kind regards.

User avatar
Henry MultiСharts
Posts: 8520
Joined: 25 Aug 2011
Has thanked: 1213 times
Been thanked: 2741 times

Re: Got an error "STD exception: invalid argument"

Postby Henry MultiСharts » 12 Sep 2012

lois77 wrote:Hey Henry,

You rule!!
It worked.
This functions are so important to simplify the code and to maximize the strategy.

Just one more question, the "once cleardebug;" instruction should be placed in the beginning of the signal or is it irrelevant?

Thank you very much for the help.

Kind regards.

"once cleardebug;" is to clean up the output tab of the PowerLanguage Editor. Usually it is placed at the beginning of the code. You can delete or comment this line in case you do not need it.
These users thanked the author Henry MultiСharts for the post:
TJ


Return to “MultiCharts”