hi, I wanted to check a simple code and browsing through the chart, I realized buy signals, that shouldn’t have been triggered and I don’t see why it happened anyway.
The following example is not a trading strategy, but simply to illustrate the buy signals.
The idea is: buy, if the current bar’s OPEN is higher than the level of 3/4 of last bar’s range (in the bullish 1/4 of the last bar)
c1= Open > High[1]-((High[1]-Low[1])/4)
IF c1 then
BUY 2 CONTRACT AT MARKET
ENDIF
SET STOP pLOSS 10
SET TARGET pPROFIT 15
quickly back testing this on the DAX in the M30 time frame, I found cases where it worked as designed (case 1), but I also found examples (case 2) where c1 was not met, but a buy signal was triggered anyway.
Is there anything I am missing here or how come?
Try using parentheses in line 1, after “>”
(High[1]-((High[1]-Low[1])/4))