Skip to content
FAQ
Login
Register
Board Index
Pine Script Discussions
Pine Script Q&A
Unanswered topics
Active topics
FAQ
Search
Login
Register
Referencing the chart's resolution inside of a conditional statement?
Post Reply
Print view
2 posts • Page
1
of
1
sk123
Pine Script Rookie
Posts:
1
Joined:
December 7th, 2020
Referencing the chart's resolution inside of a conditional statement?
Quote
Mon Dec 07, 2020 11:12 am
here is an example of what I am trying to do.
If chart's resolution is 15minutes, then use 0.1 value for an indicator.
If chart's resolution is 30 minutes, then use 0.2 value.
If charts resolution is 1h, then use xyz value...
etc.
Matthew
Site Admin
Posts:
92
Joined:
July 1st, 2020
Location:
Australia
Contact:
Website
Facebook
Twitter
TradingView Profile
Re: Referencing the chart's resolution inside of a conditional statement?
Quote
Thu Dec 10, 2020 4:01 am
Hi sk123! You need to use the inbuilt variable timeframe.period to do this.
Here's a script you might find interesting that uses a boatload of conditional statements with the chart resolution:
https://zenandtheartoftrading.com/indic ... l-by-time/
- Matthew, Administrator.
Check out my Pine Script & trading courses by clicking here!
Display posts from previous:
All posts
1 day
7 days
2 weeks
1 month
3 months
6 months
1 year
Sort by
Author
Post time
Subject
Ascending
Descending
Post Reply
Print view
2 posts • Page
1
of
1
Return to “Pine Script Q&A”
Jump to
Welcome To The Pine Scripters Network!
News & Announcements
Introductions
Pine Script Discussions
Pine Script Q&A
Pine Script Scholars
Pine Script Masters
Show & Tell / Request
Share Your Scripts
Request Scripts
Trading Discussions
General Trading Discussions
Feedback & Support
Feedback & Suggestions
Request Support