Neff = 32 lag = 3 y_fde = apply_integrated_macd_poly_filter(prices, Neff) h_int_macd_poly = int_macd_poly(Neff, Nwindow) candidate = np.convolve(prices - prices[0], h_int_macd_poly) + prices[0] y_convolution = candidate[:len(prices)] axarr[2, 0].set_title("Integrated macd poly") axarr[2, 0].plot(y_fde) axarr[2, 0].plot(y_convolution, 'o', markerfacecolor='none') # f) Macd Neff_pos = 16 Neff_neg = 32 lag = 2 y_fde = apply_macd_filter(prices, Neff_pos, Neff_neg) h_macd = macd(Neff_pos, Neff_neg, Nwindow) candidate = np.convolve(prices - prices[0], h_macd) y_convolution = candidate[:len(prices)] axarr[2, 1].set_title("Macd") axarr[2, 1].plot(y_fde) axarr[2, 1].plot(y_convolution, 'o', markerfacecolor='none') plt.tight_layout() plt.show()
impulse = np.zeros(Nwindow) impulse[lag] = 1 candidate = apply_integrated_macd_poly_filter(impulse, Neff) impulse_response_fde = candidate[lag:] impulse_response_direct = int_macd_poly(Neff_modified, Nwindow) axarr[2, 0].set_title("Integrated Macd-Poly") axarr[2, 0].plot(impulse_response_fde) axarr[2, 0].plot(impulse_response_direct, 'o', markerfacecolor='none') # f) Macd Neff_pos = 16 Neff_neg = 32 lag = 2 impulse = np.zeros(Nwindow) impulse[lag] = 1 candidate = apply_macd_filter(impulse, Neff_pos, Neff_neg) impulse_response_fde = candidate[lag:] impulse_response_direct = macd(Neff_pos, Neff_neg, Nwindow) axarr[2, 1].set_title("Macd") axarr[2, 1].plot(impulse_response_fde) axarr[2, 1].plot(impulse_response_direct, 'o', markerfacecolor='none') plt.tight_layout() plt.show()
impulse[lag] = 1 candidate = apply_integrated_macd_poly_filter(impulse, Neff) impulse_response_fde = candidate[lag:] impulse_response_direct = int_macd_poly(Neff_modified, Nwindow) axarr[2, 0].set_title("Integrated Macd-Poly") axarr[2, 0].plot(impulse_response_fde) axarr[2, 0].plot(impulse_response_direct, 'o', markerfacecolor='none') # f) Macd Neff_pos = 16 Neff_neg = 32 lag = 2 impulse = np.zeros(Nwindow) impulse[lag] = 1 candidate = apply_macd_filter(impulse, Neff_pos, Neff_neg) impulse_response_fde = candidate[lag:] impulse_response_direct = macd(Neff_pos, Neff_neg, Nwindow) axarr[2, 1].set_title("Macd") axarr[2, 1].plot(impulse_response_fde) axarr[2, 1].plot(impulse_response_direct, 'o', markerfacecolor='none') plt.tight_layout() plt.show()
y_fde = apply_integrated_macd_poly_filter(prices, Neff) h_int_macd_poly = int_macd_poly(Neff, Nwindow) candidate = np.convolve(prices - prices[0], h_int_macd_poly) + prices[0] y_convolution = candidate[:len(prices)] axarr[2, 0].set_title("Integrated macd poly") axarr[2, 0].plot(y_fde) axarr[2, 0].plot(y_convolution, 'o', markerfacecolor='none') # f) Macd Neff_pos = 16 Neff_neg = 32 lag = 2 y_fde = apply_macd_filter(prices, Neff_pos, Neff_neg) h_macd = macd(Neff_pos, Neff_neg, Nwindow) candidate = np.convolve(prices - prices[0], h_macd) y_convolution = candidate[:len(prices)] axarr[2, 1].set_title("Macd") axarr[2, 1].plot(y_fde) axarr[2, 1].plot(y_convolution, 'o', markerfacecolor='none') plt.tight_layout() plt.show()