-
-
Save zachlim98/16a474ad6f053c4336f44dab157513b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elif data["Pos"][i-1] == 1: | |
data["SL"][i] = data["SL"][i-1] | |
data["TP"][i] = data["TP"][i-1] | |
if (data[ticker][i] > data["SL"][i-1]) or (data[ticker][i] < data["TP"][i-1]): | |
data["Pos"][i] = 1 | |
if (data[ticker][i] < data["SL"][i]) or (data[ticker][i] > data["TP"][i-1]): | |
data["Pos"][i] = 0 | |
data["Sell_Signal"][i] = 1 | |
elif data["Pos"][i-1] == -1: | |
data["SL"][i] = data["SL"][i-1] | |
data["TP"][i] = data["TP"][i-1] | |
if (data[ticker][i] < data["SL"][i-1]) or (data[ticker][i] > data["TP"][i-1]): | |
data["Pos"][i] = -1 | |
if (data[ticker][i] > data["SL"][i]) or (data[ticker][i] < data["TP"][i-1]): | |
data["Pos"][i] = 0 | |
data["Sell_Signal"][i] = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment