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
It is there as a capability in the Platform, but IG don’t allow us to use it!
Hi GraHal, I would already be very happy if I can use it in backtesting on my paper trading account from IB. But that does also not seem to work.
Do you know if that is correct?
Oh so with IB … you can do backtesting of strategy that you want to trade manual … is that correct?
As we are informed that with IB you cannot do Auto-trading … is that correct?
We can do partial closures on our Demo Accounts on backtest and forward test, but not on Real Live.
Thank you for your answers, and very strange it did not work for me. But now I test again…. off course it works.
GraHal is right, it is possible in any but not yet in live trading.
Automated trading with Interactive Broker (IB) should be available in a near future as I heard.
Hi Nicolas, that is very good to hear. Thank you.
Interesting 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.
Hello,
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
https://www.prorealcode.com/blog/learning/partial-closure-positions-price-retracing-complete-function/
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.
Currently 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):
Sell 1 contract at MARKET
Exitshort 0.6 contract at MyExitPrice LIMIT
Exitshort 1.5 contract at MyExitPrice STOP
Beware no to leave open a quantity less than the minimum required by the broker.
Ciao 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
endif
IF 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
endif
Br Anders
Try replacing these two lines as follows:
elsif SellHalfL AND abs(CountOfPosition) = PositionSize THEN
elsif SellHalfS AND abs(CountOfPosition) = PositionSize THEN
they should work, unless there is something affecting Positionsize elsewhere in your code.