Professional Documents
Culture Documents
BITB
BITB
import pandas as pd
is_out = True
for i in range(df.shape[0]):
row = df.iloc[i]
if is_out:
if row["rsi"] < 30 and row["macd"] > row["macd_signal"] and
row["close"] < row["lower_band"]:
# create market buy order for lot size 0.05 in USD/JPY
is_out = False
else:
if row["close"] >= take_profit_level or (row["rsi"] > 70 and
row["macd"] < row["macd_signal"] and row["close"] > row["upper_band"]) or
row["close"] <= stop_loss_level:
# create market sell order for lot size 0.05 in USD/JPY
is_out = True
if __name__ == "__main__":
df = pd.read_csv("USD_JPY_hourly_price_data.csv")
binary_bot(df, take_profit_level=10, stop_loss_level=5)