I have implemented some trading strategies like macd and sma. When the lines are crossing they give a sell or buy signal.
Now I have calculated pivot points of one day
last_day['Pivot'] = (max_value + min_value + close)/3
last_day['R1'] = 2*last_day['Pivot'] - min_value
last_day['S1'] = 2*last_day['Pivot'] - max_value
last_day['R2'] = last_day['Pivot'] + (max_value - min_value)
last_day['S2'] = last_day['Pivot'] - (max_value - min_value)
last_day['R3'] = last_day['Pivot'] + 2*(max_value - min_value)
last_day['S3'] = last_day['Pivot'] - 2*(max_value - min_value)
return last_day
my data now looks like this:
timestamp open high low close volume macd macds macdh open_5_sma open_10_sma macd_advice msa_advice Pivot
1 2020-10-13T19:30:00.000Z 0.033259 0.033273 0.033223 0.033244 1262.011 -0.000035 -3.931010e-05 4.144859e-06 0.033236 0.033225 HOLD BUY 0.033388
2 2020-10-13T19:45:00.000Z 0.033244 0.033248 0.033211 0.033211 1068.909 -0.000036 -3.858108e-05 2.916057e-06 0.033239 0.033224 HOLD HOLD 0.033388
3 2020-10-13T20:00:00.000Z 0.033211 0.033216 0.033181 0.033211 1329.222 -0.000036 -3.799490e-05 2.344739e-06 0.033235 0.033219 HOLD HOLD 0.033388
4 2020-10-13T20:15:00.000Z 0.033211 0.033231 0.033192 0.033194 1109.637 -0.000037 -3.771359e-05 1.125225e-06 0.033238 0.033221 HOLD HOLD 0.033388
5 2020-10-13T20:30:00.000Z 0.033193 0.033199 0.033161 0.033165 597.887 -0.000039 -3.801485e-05 -1.205013e-06 0.033224 0.033226 SELL SELL 0.033388
In the data above I've only added Pivots now, I'm able to add S1, S2, S3 and R1, R2, R3
How can I create a buy/sell strategy using this data? I don't need code of course but just someone who can explain when you know when you have to buy or sell something depending on the position of the current price depending on the pivot point (or R1/S1).