Repaint Demonstration in Security Function Call using Higher TF
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © akrit8888
// @version=4

// "This Script is for demonstration of repaint by using security function to lookup the Future" 
// "And should NOT by any means be use in as a real trading strategy."

strategy("Repaint Demonstration in Security Function Call using Higher TF", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

bigTF = input("W", "Future Sight: ", input.resolution)
bigTFClose = security(syminfo.tickerid, bigTF, close)


buy = crossover(close, bigTFClose)
sell = crossover(bigTFClose, close)

plot(close)
plot(bigTFClose)
strategy.entry("L", true, when = buy)
strategy.close("L", when = sell)