I am so happy to find this. I want to buy some chocolate for you <3
For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Y
Best posts made by ylu
-
RE: Closed trade list (including MFE/MAE) analyzer
Latest posts made by ylu
-
RE: Closed trade list (including MFE/MAE) analyzer
I am so happy to find this. I want to buy some chocolate for you <3
-
RE: RSI is buying at wrong value
Now it did not close position.. what is wrong ??
def next(self): if self.order: return # pending order execution if not self.position: if self.trendline > 0: if self.rsi < 45: self.order = self.buy() if self.position: if self.rsi >= 65: self.close() if self.data.close[0] <= self.sma: self.close()
Is that happening to only me ??
-
RSI is buying at wrong value
Hello everyone, I am working on improve my TA skills to hit a career on Investment Banking so that i am interested on backtests by backtrader.
I have a problem about RSI indicator. I am writing many statements but it is still close.buy over RSI 70.
Here is my code related RSI.def __init__(self): self.EMAh = bt.talib.EMA(self.data.close, timeperiod = 8) self.EMAo = bt.talib.EMA(self.data.close, timeperiod = 18) self.EMAy = bt.talib.EMA(self.data.close, timeperiod = 27) self.crossoverhy = self.EMAh - self.EMAy self.crossoveroy = self.EMAo - self.EMAy self.crossoverho = self.EMAh - self.EMAo self.x = self.EMAy - self.data.close[0] self.y = self.EMAo - self.data.close[0] self.z = self.EMAh - self.data.close[0] # Control marketh trend self.sma = bt.indicators.SMA(self.data.close, period=self.p.smaperiod) self.smadir = self.sma - self.sma(-self.p.dirperiod) self.rsi = bt.talib.RSI(self.data.close, period=36) self.trendline = self.data.close[0] - self.sma
and,
def next(self): if self.order: return if not self.position: if self.trendline > 0: if self.rsi < 45: self.order = self.buy() if self.position: if self.trendline > 0: if self.rsi > 70: self.close()
Here is plot:
What is wrong with my code, what it is not selling at this point and if I keep adding 3EMA method it is buying when RSI 80.
Why this is happening ?
Thank you for your time.