cyberrider

time_filters

Library "time_filters"
Collection of filters that related with time like sessions and datetime ranges.
All existing session functions I found in the documentation e.g. not na(time(timeframe.period, sessionTimes))
are not suitable for strategies, since the execution of the entries and the exits are delayed by one bar.
Thus I created this library to overcome this small but very important limitation.

is_in_date_range(fromDate, toDate, srcTimezone, dstTimezone, t)
  is_in_date_range - Check if the given time is between the start and end dates
  Parameters:
    fromDate: - The start date in UNIX time of the valid range
    toDate: - The end date in UNIX time of the valid range
    srcTimezone: - The timezone of reference for the 'from' and 'to' dates
    dstTimezone: - The target timezone to convert the 'from' and 'to' dates
    t: - The time to compare in UNIX format
  Returns: series of bool whether or not the time is inside the valid range

is_in_session(startTime, endTime, days, srcTimezone, dstTimezone, t)
  is_in_session - Check if the given time is inside the session as defined by the input params
  Parameters:
    startTime: - The sessionTime object with the use flag and the start time
    endTime: - The sessionTime object with the use flag and the end time
    days: - The sessionDays object with the use flag and marks for each day of the session
    srcTimezone: - The timezone of reference for the time ranges
    dstTimezone: - The target timezone to convert the time ranges
    t: - The current time to compare in UNIX format.
  Returns: series of bool whether or not the time is inside the session

sessionTime
  Fields:
    hourInDay
    minuteInHour

sessionDays
  Fields:
    mon
    tue
    wed
    thu
    fri
    sat
    sun
ไลบรารีไพน์

จิตวิญญาณที่แท้จริงของ TradingView ผู้เขียนได้ตีพิมพ์รหัส Pine นี้เป็นไลบรารีโอเพนซอร์ซเพื่อให้โปรแกรมเมอร์คนอื่น ๆ จากชุมชนของเราสามารถนำไปใช้ซ้ำได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ไลบรารีนี้เป็นการส่วนตัวหรือในสิ่งพิมพ์โอเพนซอร์สอื่น ๆ แต่นำรหัสนี้มาใช้ซ้ำในสิ่งพิมพ์จะถูกควบคุมโดย กฎระเบียบการใช้งาน

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการใช้ไลบรารีนี้หรือไม่?

คัดลอกข้อความไปยังคลิปบอร์ดแล้ววางลงในสคริปต์ของคุณ