BoxDay Automated algo
Forums › ProRealTime English forum › General trading discussions › BoxDay Automated algo
- This topic has 2 replies, 2 voices, and was last updated 3 years ago by robertogozzi.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
08/10/2021 at 12:58 PM #175014
Hi.
I am still a beginner, and i found an intresting overlayindicator.
I would like to ask for help creating a strategy-file based on this one.When greenbox starts enter long.
When redbox starts enter short
DyBox Overlay1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950// DayBox Overlay//// TODO:// * Fix last bar redraw// * Add timeframe detection// * Add colors customizationif day <> day[1] thenpClose = close[1]middle = start+ROUND((barindex[1]-start)/2)if pOpen < pClose thenDRAWRECTANGLE(start, pOpen, barindex[1], pClose) coloured(0,204,204,50) bordercolor(0,204,204,50)DRAWRECTANGLE(middle, pOpen, (middle+1), pLow)coloured(150,150,150,255) bordercolor(150,150,150,255)DRAWRECTANGLE(middle, pClose, (middle+1), pHigh)coloured(150,150,150,255) bordercolor(150,150,150,255)elseDRAWRECTANGLE(start, pOpen, barindex[1], pClose) coloured(220,100,100,50) bordercolor(220,100,100,50)DRAWRECTANGLE(middle, pOpen, (middle+1), pHigh)coloured(150,150,150,255) bordercolor(150,150,150,255)DRAWRECTANGLE(middle, pClose, (middle+1), pLow)coloured(150,150,150,255) bordercolor(150,150,150,255)endifstart = barindexpOpen = openpHigh = closepLow = openendifif islastbarupdate thenpClose = closemiddle = start+ROUND((barindex-start)/2)if pOpen < pClose thenDRAWRECTANGLE(start, pOpen, barindex, pClose) coloured(0,204,204,50) bordercolor(0,204,204,50)DRAWRECTANGLE(middle, pOpen, (middle+1), pLow)coloured(150,150,150,50) bordercolor(150,150,150,50)DRAWRECTANGLE(middle, pClose, (middle+1), pHigh)coloured(150,150,150,50) bordercolor(150,150,150,50)elseDRAWRECTANGLE(start, pOpen, barindex, pClose) coloured(220,100,100,50) bordercolor(220,100,100,50)DRAWRECTANGLE(middle, pOpen, (middle+1), pHigh)coloured(150,150,150,50) bordercolor(150,150,150,50)DRAWRECTANGLE(middle, pClose, (middle+1), pLow)coloured(150,150,150,50) bordercolor(150,150,150,50)endifendifif high > pHigh thenpHigh = highendifif low < pLow thenpLow = lowendifreturnCreated by Gabi: https://www.prorealcode.com/topic/extratrend-exemples-de-codage-screeners-et-programmation-personnalisee/page/7/#post-174207
Thanks in advance
08/11/2021 at 9:35 AM #17508408/13/2021 at 8:58 AM #175222There you go:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061DEFPARAM CumulateOrders = FALSE// DayBox Overlay//// TODO:// * Fix last bar redraw// * Add timeframe detection// * Add colors customizationONCE signal = 0if day <> day[1] thenpClose = close[1]middle = start+ROUND((barindex[1]-start)/2)if pOpen < pClose thenSignal = 1//DRAWRECTANGLE(start, pOpen, barindex[1], pClose) coloured(0,204,204,250) bordercolor(0,204,204,50)//DRAWRECTANGLE(middle, pOpen, (middle+1), pLow)coloured(150,150,150,255) bordercolor(150,150,150,255)//DRAWRECTANGLE(middle, pClose, (middle+1), pHigh)coloured(150,150,150,255) bordercolor(150,150,150,255)elseSignal = -1//DRAWRECTANGLE(start, pOpen, barindex[1], pClose) coloured(220,100,100,250) bordercolor(220,100,100,50)//DRAWRECTANGLE(middle, pOpen, (middle+1), pHigh)coloured(150,150,150,255) bordercolor(150,150,150,255)//DRAWRECTANGLE(middle, pClose, (middle+1), pLow)coloured(150,150,150,255) bordercolor(150,150,150,255)endifstart = barindexpOpen = openpHigh = closepLow = openendifif islastbarupdate thenpClose = closemiddle = start+ROUND((barindex-start)/2)if pOpen < pClose then//DRAWRECTANGLE(start, pOpen, barindex, pClose) coloured(0,204,204,250) bordercolor(0,204,204,50)//DRAWRECTANGLE(middle, pOpen, (middle+1), pLow)coloured(150,150,150,250) bordercolor(150,150,150,50)//DRAWRECTANGLE(middle, pClose, (middle+1), pHigh)coloured(150,150,150,250) bordercolor(150,150,150,50)else//DRAWRECTANGLE(start, pOpen, barindex, pClose) coloured(220,100,100,250) bordercolor(220,100,100,50)//DRAWRECTANGLE(middle, pOpen, (middle+1), pHigh)coloured(150,150,150,250) bordercolor(150,150,150,50)//DRAWRECTANGLE(middle, pClose, (middle+1), pLow)coloured(150,150,150,250) bordercolor(150,150,150,50)endifendifif high > pHigh thenpHigh = highendifif low < pLow thenpLow = lowendifx = 0If Signal <> Signal[1] THENx = 1ENDIF/////////////////////////////////////////////////////////////////IF x <> 0 THENIF Signal = 1 AND Not LongOnMarket thenBUY 1 Contract AT MarketELSIF Signal = -1 AND Not ShortOnMarket thenSELLSHORT 1 Contract AT MarketENDIFENDIFSET TARGET pPROFIT 300SET STOP pLOSS 100 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on
Similar topics: