Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ****************************************************************************************************************************************************************
- // Call combine signals and execute buy/sell positions within the timeframe
- //.****************************************************************************************************************************************************************
- // Date Range To Include
- startDate = timestamp("2018-01-01T00:00")
- endDate = time
- // Check if the current timestamp is within the restricted range
- inRestrictedRange = time >= startDate and time <= endDate
- //
- // Buy Signals on overbought and oversold
- //
- if longCondition and inRestrictedRange // ADD OTHER BUY SIGNAL BOOLS
- strategy.entry("My Long Entry Id", strategy.long, 100)
- if shortCondition and inRestrictedRange // ADD OTHER BUY SIGNAL BOOLS
- strategy.entry("My Short Entry Id", strategy.short, 100)
- // longCondition and shortCondition are bools defined in the indicator which tell you if you take on a buy or sell condition...
- // I sometimes use an int which I set to 1 or -1. It depends on the way the indicator is setup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement