Skip to content

Commit

Permalink
#10 fix keywords for trends
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim55667757 committed Jan 5, 2023
1 parent 9586b35 commit 89a4825
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pricegenerator/PriceGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,12 +838,12 @@ def Generate(self) -> pd.DataFrame:
# -- Change last candle in every trend:
lowDelta = min(candles[-1]["open"], candles[-1]["close"]) - candles[-1]["low"] # lower shadow
highDelta = candles[-1]["high"] - max(candles[-1]["open"], candles[-1]["close"]) # higher shadow
if self.trendSplit[trendNum] == "/":
if trends[trendNum] == "up":
if firstCandle["close"] >= candles[-1]["close"]:
candles[-1]["high"] = round(random.uniform(a=firstCandle["close"], b=self.maxClose), self.precision)
candles[-1]["close"] = round(random.uniform(a=candles[-1]["open"], b=candles[-1]["high"]), self.precision)

elif self.trendSplit[trendNum] == "\\":
elif trends[trendNum] == "down":
if firstCandle["close"] < candles[-1]["close"]:
candles[-1]["low"] = round(random.uniform(a=self.minClose, b=firstCandle["close"]), self.precision)
candles[-1]["close"] = round(random.uniform(a=candles[-1]["low"], b=candles[-1]["open"]), self.precision)
Expand Down

0 comments on commit 89a4825

Please sign in to comment.