INNER CODE UNIT · Python
nz
Mo-Khalifa96/Forex-Trading-Bot · DataProcessing.py:7
def nz(x, y=None):
if x is np.nan or x is None:
if y is not None and y is not np.nan:
return y
else:
return 0
else:
return x
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