traderstu22

TS2_Intraday_Times

41
Added warning time slots
Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
//Created By ChrisMoody on 9-14-2014 To plot Background Highlights for Recurring Times
//Edited by TS2 with static time frame inspirations from TraderMentatlity: http://www.tradermentality.com/2016/02/intraday-reversal-times.html
// added prewarning time slots, cause sometimes, you want to know when the reversal might be coming

study(title="TS2_Intraday_Times", shorttitle="TS2_Intraday_Times",overlay=true)

use0 = input(true, title="Show 9:30-9:35")
use1 = input(true, title="Show 9:50-10:10")
use2 = input(true, title="Show 10:25-10:35")
use3 = input(true, title="Show 11:15")
use4 = input(true, title="Show 12:00")
use5 = input(true, title="Show 12:45")
use6 = input(true, title="Show 1:30")
use7 = input(true, title="Show 2:15")
use8 = input(true, title="Show 3:00")
use9 = input(true, title="Show 3:30")

useP = input(true, title="Show prewarning?")

sess0 = '0930-0935'
sess1 = '0950-1010'
sess2p = '1020-1025'
sess2 = '1025-1035'
sess3p = '1110-1111'
sess3 = '1115-1116'
sess4p = '1155-1156'
sess4 = '1200-1201'
sess5p = '1240-1241'
sess5 = '1245-1246'
sess6p = '1325-1326'
sess6 = '1330-1331'
sess7p = '1410-1411'
sess7 = '1415-1416'
sess8p = '1455-1456'
sess8 = '1500-1501'
sess9p = '1525-1526'
sess9 = '1530-1531'

bgPlot0 = time(period, sess0)
bgPlot1 = time(period, sess1)
bgPlot2 = time(period, sess2)
bgPlot3p = time(period, sess3p)
bgPlot3 = time(period, sess3)
bgPlot4p = time(period, sess4p)
bgPlot4 = time(period, sess4)
bgPlot5p = time(period, sess5p)
bgPlot5 = time(period, sess5)
bgPlot6p = time(period, sess6p)
bgPlot6 = time(period, sess6)
bgPlot7p = time(period, sess7p)
bgPlot7 = time(period, sess7)
bgPlot8p = time(period, sess8p)
bgPlot8 = time(period, sess8)
bgPlot9p = time(period, sess9p)
bgPlot9 = time(period, sess9)

bgcolor(use0 and bgPlot0 > 0 ? yellow : na, transp=75)
bgcolor(use1 and bgPlot1 > 0 ? yellow : na, transp=75)
bgcolor(use2 and bgPlot2 > 0 ? yellow : na, transp=75)
bgcolor(use3 and bgPlot3p and useP > 0 ? blue : na, transp=75)
bgcolor(use3 and bgPlot3 > 0 ? yellow : na, transp=75)
bgcolor(use4 and bgPlot4p and useP > 0 ? blue : na, transp=75)
bgcolor(use4 and bgPlot4 > 0 ? yellow : na, transp=75)
bgcolor(use5 and bgPlot5p and useP > 0 ? blue : na, transp=75)
bgcolor(use5 and bgPlot5 > 0 ? yellow : na, transp=75)
bgcolor(use6 and bgPlot6p and useP > 0 ? blue : na, transp=75)
bgcolor(use6 and bgPlot6 > 0 ? yellow : na, transp=75)
bgcolor(use7 and bgPlot7p and useP > 0 ? blue : na, transp=75)
bgcolor(use7 and bgPlot7 > 0 ? yellow : na, transp=75)
bgcolor(use8 and bgPlot8p and useP > 0 ? blue : na, transp=75)
bgcolor(use8 and bgPlot8 > 0 ? yellow : na, transp=75)
bgcolor(use9 and bgPlot9p and useP > 0 ? blue : na, transp=75)
bgcolor(use9 and bgPlot9 > 0 ? yellow : na, transp=75)