Access trade.ref



  • Is it possible to access trade.ref inside next() in strategy? How?


  • administrators

    If you keep a reference to the notified Trade during notify_trade you will be able to access any of its attributes.

    Per se there is no trade.ref



  • @backtrader Hey just came across this searching for info. How do you mean 'no trade.ref' as it's in the trade object. Thanks
    e.g.

    ref:3 <-- here
    data:<backtrader.feeds.csvgeneric.GenericCSVData object at 0x1032cf438>
    tradeid:0
    size:0
    price:88.800003
    value:0.0
    commission:0.0
    pnl:3.2400050000000107
    pnlcomm:3.2400050000000107
    justopened:False
    isopen:False
    isclosed:True
    baropen:14
    dtopen:736338.0006944444
    barclose:30
    dtclose:736346.0013888889
    barlen:16
    historyon:False
    history:[]
    status:2


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.