Hello! I want to code something for the following examples:
1) Alert when SPY is down 10% in 1 day
2) Alert when SPY is down 10% in 1 week (or last 5-7 trading days).
3) Alert when SPY is down 10% in 1 month (or last 20-30 trading days).
For week: Alert either within the Weekly chart SPY candle or last 5-7 days (Don't know if there is a difference)
Same thing for month: Alert either within the Monthly SPY candle or the last 20-30 trading days.
I'm not a coder. Browsing the internet here's what I came up with, which I'm sure is wrong and not working properly:
Current code for each example above, 1 through 3:
1) (close - open) / open <= 0.1
or should this be (close - open) / open <= 1.0
[Using the Daily interval] For Alerts when SPY is down 10% in 1 day
Also trying this code for the same thing:
If this code is correct, should the number for 1% percent be 0.1 or 1.0?
For 2) and 3) I'm using the exact same codes, but with the different time intervals Week and Month.
Thank you for your help!
1) Alert when SPY is down 10% in 1 day
2) Alert when SPY is down 10% in 1 week (or last 5-7 trading days).
3) Alert when SPY is down 10% in 1 month (or last 20-30 trading days).
For week: Alert either within the Weekly chart SPY candle or last 5-7 days (Don't know if there is a difference)
Same thing for month: Alert either within the Monthly SPY candle or the last 20-30 trading days.
I'm not a coder. Browsing the internet here's what I came up with, which I'm sure is wrong and not working properly:
Current code for each example above, 1 through 3:
1) (close - open) / open <= 0.1
or should this be (close - open) / open <= 1.0
[Using the Daily interval] For Alerts when SPY is down 10% in 1 day
Also trying this code for the same thing:
If this code is correct, should the number for 1% percent be 0.1 or 1.0?
For 2) and 3) I'm using the exact same codes, but with the different time intervals Week and Month.
Thank you for your help!