INNER CODE UNIT · Python
Cross
Mo-Khalifa96/Forex-Trading-Bot · DataProcessing.py:16
def Cross(dfclose, sptlist):
if cross(dfclose[-len(sptlist):], pd.Series(sptlist)):
return True
else:
return False
def Indicator(df_rates_orig: pd.DataFrame):
'''
This function takes a dataframe with the candlesticks for a given symbol, applies the indicator or trading strategy
analysis, and returns back 3 key indicator variables:
maximum: the indicator's green line,
average: the indicator's orange line, &
minimum: the indicator's red line. \n
**Note, it processes up to next to last candle only.**
'''
# Define empty lists for indicator variables