Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
576 B
1
Indexable
Never
//@version=5
indicator("Outside Bar Strategy", overlay=true)

// Define outside bar conditions
isOutsideBar = high > high[1] and low < low[1]

// Entry condition: Buy on outside bar up, Sell on outside bar down
if isOutsideBar
    strategy.entry("OutsideBarUp", strategy.long, comment="Outside Bar Up")
    strategy.entry("OutsideBarDown", strategy.short, comment="Outside Bar Down")

// Exit condition: Close positions
if isOutsideBar
    strategy.close("OutsideBarUp", comment="Close Outside Bar Up")
    strategy.close("OutsideBarDown", comment="Close Outside Bar Down")


Leave a Comment