From the MC PowerLanguage docs....PosTradeExitCategory  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

From the MC PowerLanguage docs....PosTradeExitCategory

Postby syswizard » 23 May 2016

Several descriptions below are completely wrong.....
----------------------------------------------------------------------------------------------------------------
PosTradeExitCategory

Returns an absolute numerical value, indicating the trade exit order category. The following numerical returns are possible:

1 = Stop order (buy next bar at close - 1 point stop), <= This description is wrong

2 = Limit order (buy next bar at close + 1 point limit), <= This description is wrong

3 = Market order (buy next bar market),

4 = Market at Close order (buy this bar at close),

5 = Market at Open order (buy next bar open),

8 = StopLimit order (buy 1 contracts next bar at close - 2 point stop close + 2 point limit).
<= This description is wrong

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

Re: From the MC PowerLanguage docs....PosTradeExitCategory  [SOLVED]

Postby Henry MultiСharts » 24 May 2016

Hello syswizard,

We have checked it on our end and confirm that all the returned values are correct:

Code: Select all

once cleardebug;
//--------
buy next bar at close - 1 point stop;
sell next bar at close + 1 point stop;
Print(PosTradeExitCategory(1,0), " 1");
//-----
buy next bar at close + 3 point limit;
sell next bar at close - 3 point limit;
Print(PosTradeExitCategory(1,0), " 2");
//-------
buy next bar market;
sell next bar market;
Print(PosTradeExitCategory(1,0), " 3");
//----
buy this bar at close;
sell this bar at close;
Print(PosTradeExitCategory(1,0), " 4");
//------
buy next bar open;
sell next bar open;
Print(PosTradeExitCategory(1,0), " 5");
//---
buy 1 contracts next bar at close - 1 point stop close + 3 point limit;
sell 1 contracts next bar at close + 1 point stop close - 3 point limit;
Print(PosTradeExitCategory(1,0), " 8");

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: From the MC PowerLanguage docs....PosTradeExitCategory

Postby syswizard » 27 May 2016

I know that, but look at the descriptions carefully.
You can't place a buy stop under the market.....it will be converted to a market order.

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

Re: From the MC PowerLanguage docs....PosTradeExitCategory

Postby Henry MultiСharts » 10 Jun 2016

I know that, but look at the descriptions carefully.
You can't place a buy stop under the market.....it will be converted to a market order.
You can do that and you can learn what was your order, that's the point of this keyword. Whether it will be converted or not depends on the broker.


Return to “MultiCharts”