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

Buy and sell plotting bugging

  • Hi,

    I just started with python and backtrader and I think I am having bugs with the plotting of the buy and sell signals on my strategy.

    Do you know how to make the arrows be exactly on the price they were applied to ?


    alt text

  • @ab_trader would for sure say show us the money (code) (or at least a proof of concept) and this would be endorsed, but the chart seems to give a hint:

    • The arrows are centered around something call SLTP Tracking. It would seem that's the asset which is actually being bought and sold

    But yes, no code ... no fun.

  • SLTP Tracking observer shows stop loss and take profit levels. It should be aligned with prices by default. Since it is not, then definitely something is wrong with the strategy code.

Log in to reply