Advertisement
NKactive

Untitled

Aug 11th, 2023
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // ****************************************************************************************************************************************************************
  2. // Call combine signals and execute buy/sell positions within the timeframe
  3. //.****************************************************************************************************************************************************************
  4. // Date Range To Include
  5. startDate = timestamp("2018-01-01T00:00")
  6. endDate = time
  7. // Check if the current timestamp is within the restricted range
  8. inRestrictedRange = time >= startDate and time <= endDate
  9. //
  10. // Buy Signals on overbought and oversold
  11. //
  12. if longCondition and inRestrictedRange // ADD OTHER BUY SIGNAL BOOLS
  13. strategy.entry("My Long Entry Id", strategy.long, 100)
  14. if shortCondition and inRestrictedRange // ADD OTHER BUY SIGNAL BOOLS
  15. strategy.entry("My Short Entry Id", strategy.short, 100)
  16. // longCondition and shortCondition are bools defined in the indicator which tell you if you take on a buy or sell condition...
  17. // 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