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

LinePlotterIndicator doesn't write to csv

  • I am using the bt.Writer to write to a csv and already have my data feeds and indicators writing successfully to the file.

    I would now like to create some custom parameters, lets say for example (2 * close(-1) / volume), and have those output to the csv. I tried to create a LinePlotterIndicator in my strategy in the init function.

    pricevol = 2 * /
    pv = bt.LinePlotterIndicator(pricevol, name='pricevol')
    pv.csv = True

    As you can see in the plot below, I am seeing the result of LinePlotterIndicator in red, but I'm also getting 10 other values that seem to be related to the LinesCouplers. I think the LinesCouplers are from using the PivotPoint indicator although I don't seem to be able to get rid of them even when I set plot=False on the PP indicator.

    0_1531901240217_Screen Shot 2018-07-18 at 10.03.58 AM.png

    In the csv file, I just see see 11 empty columns for pricevol

    0_1531901296404_Screen Shot 2018-07-18 at 10.07.39 AM.png

    How can I get the pricevol to output to the csv and just as one column instead of 11.

  • administrators

    LinePlotterIndicator is not a real indicator but a wrapper to show lines on the chart, hence the name.

    If you want the output, you should wrap the operations you want considered in indicator classes.

Log in to reply