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
From the MC PowerLanguage docs....PosTradeExitCategory [SOLVED]
- 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]
Hello syswizard,
We have checked it on our end and confirm that all the returned values are correct:
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");
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: From the MC PowerLanguage docs....PosTradeExitCategory
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.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.