For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
IB trailing stop price
-
Hi
I am trying to implement trailing stop in IB paper account but I find the execution odd or I lack understanding in it.
Is there a way in next{} to get the trailing stop price in tws at every step?Am not sure if this will work in IB (got from docs) :
print('trailing price long: {}, short: {}'.format(self.long_trailstop.created.price, self.short_trailstop.created.price))
Thanks!!
-
I read again IB's definition on trailing stop. It says it follows the market price, and I think if its a sell stop, it trails the high. I was expecting it to trail the interval I am looking at, for example, trail the close of 5min candle...apparently not but maybe it makes sense as not sure if IB knows I am looking at 5 min bars or 1 min bars or 4 hour bars?