Last active
October 19, 2023 20:11
-
-
Save marketcalls/b7db3d34ef3e089168dd33550f7f28a3 to your computer and use it in GitHub Desktop.
Previous Day High Low Breakout Trading System
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Coded by Rajandran R (Founder of Marketcalls and Co-Founder of Traderscafe.in | |
//Website : www.marketcalls.in | |
//Date : 16 Apr 2018 | |
_SECTION_BEGIN("Simple Trading System - Previous Day High Low Breakout"); | |
SetChartOptions(0,chartShowArrows|chartShowDates); | |
_N(Title = StrFormat(EncodeColor( colorGold) + "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) )); | |
SetChartOptions(0,chartShowArrows|chartShowDates); | |
Plot( C, "Price", colorDefault, styleCandle ); | |
// Go Long - if prev day high is broken and stop loss prev day low | |
// Go Short - if prev day low is broken and stop loss prev day high | |
SetPositionSize(150,spsshares); | |
PDH = TimeFrameGetPrice("H",inDaily,-1); | |
PDL = TimeFrameGetPrice("L",inDaily,-1); | |
//Trade Entry/Exit Filter | |
iFilter = Optimize("Filter",1,1,100,1); | |
Plot(PDH+ifilter,"Upper",colorGreen,styleLine | styleThick); | |
Plot(PDL-ifilter,"Lower",colorRed,styleLine | styleThick); | |
//Trading Rules for touch of levels | |
Buy = Cross(H,PDH+ifilter); | |
Sell = Cross(PDL-ifilter,L); | |
Buy = ExRem(Buy,Sell); | |
Sell = ExRem(Sell,Buy); | |
Short = Sell; | |
Cover = Buy; | |
//Trade Execution Price - Gap Up and Gap Down Execution Rules Considered | |
BuyPrice = Max(Open,PDH+ifilter); | |
SellPrice = Min(Open,PDL-ifilter); | |
ShortPrice = Min(Open,PDL-ifilter); | |
CoverPrice = Max(Open,PDH+ifilter); | |
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40); | |
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50); | |
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45); | |
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40); | |
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50); | |
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45); | |
_SECTION_END(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hola, este código es para TradingView? en caso contrario para qué plataforma está creado ?