ChrisMoody

CM_DayOfWeek All Instruments V2

Updated Code That Highlights Bars Based On Days Of The Week.

Works On Daily and Intra-Day Bars.

Works on All Instruments. Stocks, Forex, Futures, Bitcoin.

Shows Correct Trading Sessions!!!

Ability to Turn On/Off Each Day Of The Week via Inputs Panel.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
//Created By ChrisMoody on 5-2-2014 - Updated on 10-28-2014
//Updates include Code now works for Stocks, Forex, Futures, bitcoin etc.
//Highlights Bars Based on Correct Trading Session.
//Colors Bars for Stocks Monday-Friday
study("CM_DayOfWeek_V2", overlay=true)
disMon = input(true, title="Highlight Monday?")
disTue = input(false, title="Highlight Tuesday?")
disWed = input(false, title="Highlight Wednesday?")
disThur = input(false, title="Highlight Thursday?")
disFri = input(false, title="Highlight Friday?")

isMon() => dayofweek(time('D')) == monday and close ? 1 : 0
isTue() => dayofweek(time('D')) == tuesday and close ? 1 : 0
isWed() => dayofweek(time('D')) == wednesday and close ? 1 : 0
isThu() => dayofweek(time('D')) == thursday and close ? 1 : 0
isFri() => dayofweek(time('D')) == friday and close ? 1 : 0

barcolor(disMon and isMon() ? (isMon() ? yellow : na) : na)
barcolor(disTue and isTue() ? (isTue() ? fuchsia : na) : na)
barcolor(disWed and isWed() ? (isWed() ? gray : na) : na)
barcolor(disThur and isThu() ? (isThu() ? aqua : na) : na)
barcolor(disFri and isFri() ? (isFri() ? orange : na) : na)