![]() Your thoughts would be greatly appreciated - thanks once again on a sterling indicator. Currently its stopped at 14 sept - and a few weeks ago it had stopped at mid June, so it seems to change.įirstly, hope you don't mind me having a crack at your indicator, it was good practice =)Īnd Secondly, do you know why there seems to be a limit to the historic sessions? you can show 80 sessions prior, cutting it off at say 40, so you dont see sessions current, to 40) but this didn't seem to work, it still stops working at a certain amount of sessions. Session Box is free to use the Google Chrome extension that allows you to use websites with multiple accounts at the same time. I am a newbie coder so as a challenge I thought I'd try customising it a bit, so I added a code to it see if it was this issue, whereby now you can cut off the indicator at x amount of days (i.e. Are you able to tell me why this is? I thought it might have been an overflow problem with metatrader only being able to handle X amount of lines. label.new(bar_index, high, 'Last Bar')īox.I was hoping you could enlighten me on something - when backtesting strategies manually, using this indicator, it gets to a certain point and it seems to unravel and stop functioning correctly. label.new(bar_index, high, 'First Bar')īox.set_left(id=sessionBox, left=bar_index) IsSessionLast = IsLastBarSession("0800-0930") IsFirstBarOfSession = IsSessionStart("0800-0930") SessionLowPrice := math.min(sessionLowPrice, low) SessionLow(sessionTime, sessionTimeZone=syminfo.timezone) => SessionHighPrice := math.max(sessionHighPrice, high) ![]() InsideSession = not na(time(timeframe.period, sessionTime, sessionTimeZone)) SessionHigh(sessionTime, sessionTimeZone=syminfo.timezone) => Hour = lastBarHour and minute = lastBarMinute and second = lastBarSecond ![]() IsLastBarSession(sessionTime, sessionTimeZone=syminfo.timezone) => ![]() InSess = not na(time(timeframe.period, sessionTime, sessionTimeZone)) IsSessionStart(sessionTime, sessionTimeZone=syminfo.timezone) => SessionBox := box.new(left=bar_index, top=dayHighPrice,īorder_width=boxBorderSize, bgcolor=sessionBoxColor)//, extend=extend.right) Else, during the day, update that day's box. When a new day start, create a new box for that day. during the day track the highest high and lowest low.ĭayHighPrice := math.max(dayHighPrice, high)ĭayLowPrice := math.min(dayLowPrice, low) If a new day starts, set the high and low to that bar's data. NewDayStart = dayofmonth != dayofmonth and See if a new calendar day started on the intra-day time frame SessionBoxColor = lor(color.new(een, 85), title="Up box colour")īoxBorderSize = input.int(2, title="Box border size", minval=0) Note: Some times have to be modified in the code not all the inputs are effective! strategy('DAX breakout session', overlay=true, margin_long=100, margin_short=100) Plot(showLo and not (noPlotOutside and not timeInSession) ? lo : na, 'Lows', color.new(color.fuchsia, 0), 3, plot.style_circles)įirstBar = na(timeInSession) and not na(timeInSession) or timeInSession prevDa圜loseīox.set_border_color(sessionBox, upBorderColor)īox.set_bgcolor(sessionBox, downBoxColor)īox.set_border_color(sessionBox, downBorderColor)Īfter bodging a lot of stuff together I came up with this working solution, Plot(showHi and not (noPlotOutside and not timeInSession) ? hi : na, 'Highs', color.new(color.blue, 0), 3, plot.style_circles) We are entering allowed hours reset hi/lo. NoPlotOutside = input(true, 'Don\'t plot outside of hours') In other words, its a temporary key that is only used once, during one stretch of time, for encrypting and decrypting datasent between two parties future conversations between the two would be encrypted with different session keys. TimeInSession = time(timeframe.period, usrSession ':23456')īgcolor(timeInSession ? color.new(color.blue, 90) : na) A session key is any symmetric cryptographic key used to encrypt one communication session only. UsrTimeframe = input.timeframe('15', title="Timeframe", options=) Right now, firstBar and lastBar are boolean overlay=true) The problem for me is that I don't know how to get the bars as integer within I am stuck with drafting the coordinates for the box. I am working on this pine script where I want to draw a box from 08:00 to 09:00 and from
0 Comments
Leave a Reply. |