Hi ,
Below is my code generates a buy signal if Previous Day High is crossed.
Below is my code generates a buy signal if Previous Day High is crossed.
Code:
_SECTION_BEGIN("LongHighBreakout");
lastDayHigh = TimeFrameGetPrice( "H", inDaily, -1 );
todaysOpen = TimeFrameGetPrice("O",inDaily,0);
cond1 = C < MA(C,13);
cond2 = C < MA(C,50);
cond3 = Ref( L, -1 ) > lastDayHigh;
Plot(lastDayHigh,"Prev-High",colorGreen,styleDashed);
Buy = cond1 AND cond2 AND cond3 ;
Sell = False OR TimeNum() > 151500;
ApplyStop(stopTypeLoss,stopModePoint,lastDayHigh[0]);
ApplyStop(stopTypeProfit,stopModePercent,1);
PlotShapes(IIf(Buy, shapeUpArrow , shapeNone), colorGreen);
PlotShapes(IIf(Sell, shapeDownArrow , shapeNone), colorRed);
_SECTION_END();
Attachments
-
120.3 KB Views: 185