V11 Partial close of orders
Forums › ProRealTime English forum › ProOrder support › V11 Partial close of orders
- This topic has 12 replies, 3 voices, and was last updated 3 years ago by
robertogozzi.
-
-
07/01/2020 at 1:01 PM #137910
Hi, I think partial closing a position in V11 is still not possible. Is this true or do I make a mistake?
I want for instance buy 2 contracts and exit 1 very quickly bring the stoploss to break even and let the other contact run.
If it is really not there, when can it be expected?
Regards, Ronald
07/01/2020 at 1:08 PM #13791307/01/2020 at 1:14 PM #13791507/01/2020 at 1:22 PM #13791607/01/2020 at 1:25 PM #13791707/01/2020 at 1:32 PM #13792107/01/2020 at 1:59 PM #13792407/01/2020 at 2:02 PM #13792507/02/2020 at 8:16 AM #138047Interesting news that automated trading should be available with IB soon. Presumably that will be with v.11?
I suspect that if IB start offering A.T. on v.11 PRT traders will start leaving IG, and IG will then miraculously integrate v.11 with their platform.
05/06/2021 at 1:32 PM #168940Hello,
Could somebody advice what is the latest status on partial position closing?
Several topics have been opened over time on this subject and situation is not very clear to me.
From what I understood it is working with PRT v11 in backtest using code like the one described on
https://www.prorealcode.com/topic/bollinger-band-coding-help-please/#post-80959
or
https://www.prorealcode.com/topic/code-for-partial-close/
or
But as of May 2021 is it working with PRT v11 PRO-ORDER (i.e. live trading) with IG and maybe IB?
Thanks in advance.
05/06/2021 at 1:58 PM #168941Currently Autotrading is only available through IG.
Partial closing of positions is available with v11.
To close the whole position you simply use SELL and EXITSHORT with no LotSize (at Market, Stop or Limit). To close it partially you just need to add the quantity you want to close):
123Sell 1 contract at MARKETExitshort 0.6 contract at MyExitPrice LIMITExitshort 1.5 contract at MyExitPrice STOPBeware no to leave open a quantity less than the minimum required by the broker.
3 users thanked author for this post.
10/13/2021 at 6:40 PM #179627Ciao robertogozzi,
Thanks for great input.
How to make the code only exit half the position once, as i coded now, i exits half and then 1 minute later exit another half which i would like to keep as a runner. My current code:
SHL = ((Positionprice+(Mystop*2)))
SellHalfL = (Close > SHL)SHS = ((Positionprice+(Mystop*2)))
SellHalfS = (Close > SHL)IF LONGONMARKET THEN
IF ExitL THEN
SELL AT MARKET
elsif SellHalfL THEN
SELL ClQ CONTRACTS AT MARKET
elsif StopL THEN
SELL Positionsize CONTRACTS AT MARKET
endif
endifIF SHORTONMARKET THEN
IF ExitS THEN
EXITSHORT AT MARKET
elsif SellHalfS THEN
EXITSHORT Clq CONTRACTS AT MARKET
elsif StopS THEN
EXITSHORT Positionsize CONTRACTS AT MARKET
endif
endifBr Anders
10/14/2021 at 11:26 AM #179666Try replacing these two lines as follows:
12elsif SellHalfL AND abs(CountOfPosition) = PositionSize THENelsif SellHalfS AND abs(CountOfPosition) = PositionSize THENthey should work, unless there is something affecting Positionsize elsewhere in your code.
-
AuthorPosts
Find exclusive trading pro-tools on