For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

Trailing stop fired by High and Low instead of Close price



  • How can I modify the logic of the bt.Order.StopTrail.

    When going long I d like to adapt trail going up on high candle price and generate sale on low candle price instead of using the close price and vice versa when going short.

    Thank you


  • administrators

    Don't take me for rude, but you say "trailing stop fired ...." and I could also say "trailing stop not fired ...".

    There is no indication as to what you are doing, what's happening, if that is actually the right behavior.

    Even if what you say would make some sense ... the following is completely wrong:

    @fede3u said in Trailing stop fired by High and Low instead of Close price:

    How can I modify the logic of the bt.Order.StopTrail.

    You can also go and try to modify how the markets work. It may be easier and it will probably fit what you have backtested with something you have modified to fit your wishes and not to try to model how things work in the reality.

    If StopTrail doesn't do what you expect, these are the possible reasons:

    • You don't know how such an order works in real markets

    • You do, but it's not the order type which fits what you try to model, but you have still chosen to do it.

    Imho: very wrong way to approach your backtesting.


Log in to reply
 

});