Thank you GraHal for your suggestion. Have used the cursor details window and the Histogram Height is not above 0.00025 or below for the sell -0.00025.
And thank you Nicolas also. I have tried the integers of MACD[12, 26, 9] (close), instead of the formula MACD[37/3, 77/3, 9] (close). It did not change anything.
I rewrote the code. Mainly looking back the 5 candles. indicator2, the MACD, is formulated to be the histogram height.
Changed the minimum height of the histogram to 10, which it almost never is in forex, to illustrate that indicator2 does not work.
The trades open whether the histogram height is 0.000001 or whatever.
How does the backtest have a result if the histogram height is never correct?
The attachment shows a trade opened by backtest with the MACD Line minus signal at 0.00016 shown in the cursor details window.
Any help or suggestions appreciated.
// Main code : 1MACD 1.2 simplified +stopsFX---------------
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// BUY --------------------------------------------------------------------------------------
// Conditions to enter long positions
// MACDline crosses over 0 within 5 bars
indicator1 = MACDline[37/3, 77/3, 9](close)
c1 = (indicator1 CROSSES OVER 0)
c1 = (indicator1 CROSSES OVER 0[1])
c1 = (indicator1 CROSSES OVER 0[2])
c1 = (indicator1 CROSSES OVER 0[3])
c1 = (indicator1 CROSSES OVER 0[4])
c1 = (indicator1 CROSSES OVER 0[5])
indicator2 = MACD[37/3, 77/3, 9] (close)
c2 = (indicator2 > 10.0)
IF c1 AND c2 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit long positions
indicator3 = MACDline[37/3, 77/3, 9](close)
c3 = (indicator3 CROSSES UNDER 0)
IF c3 THEN
SELLSHORT AT MARKET
ENDIF
// SELL ------------------------------------------------------------------------------
// Conditions to enter short positions
indicator11 = MACDline[37/3, 77/3, 9](close)
c11 = (indicator11 CROSSES UNDER 0)
c11 = (indicator11 CROSSES UNDER 0[1])
c11 = (indicator11 CROSSES UNDER 0[2])
c11 = (indicator11 CROSSES UNDER 0[3])
c11 = (indicator11 CROSSES UNDER 0[4])
c11 = (indicator11 CROSSES UNDER 0[5])
indicator12 = MACD[37/3, 77/3, 9] (close)
c12 = (indicator12 < -10.0)
IF c11 AND c12 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Conditions to exit short positions
indicator14 = MACDline[37/3, 77/3, 9](close)
c14 = (indicator14 CROSSES OVER 0)
IF c14 THEN
BUY AT MARKET
ENDIF
// Stops and targets
SET STOP pTRAILING 50
SET TARGET pPROFIT 100