For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How do I print (ATR)
-
Hello,
How do I print bt.ind.ATR?
and if possible
How do I make a plot a trailing ATR stop loss? Does anyone know a tutorial/guide where I can learn this?
-
Hi Gleetche,
I guess your code would help to answer your question.
Best
-
@Jonny8 Ohh okay.
These is my atr line.
def __init__(self): self.my_atr = bt.ind.ATR(period = 14)
and I am trying to make this work.
def next(self): # Simply log the closing price of the series from the reference self.log('Close: %.2f , ATR: $.2f' % (self.dataclose[0],self.my_atr))
But it won't run.
I am trying to get the log ATRin the terminal because it is difficult to see the value of ATR in the graph.
-
@Gleetche said in How do I print (ATR):
def next(self): # Simply log the closing price of the series from the reference self.log('Close: %.2f , ATR: $.2f' % (self.dataclose[0],self.my_atr))
I think replacing the $ after "ATR:" with a % should do the trick.
Best
-
-
Sorry, typo.
self.my_atr[0]
-
thanks! it worked