MultyTimeframe
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © atomicbear96

//@version=5
// @description TODO: add library description here
library("MultyTimeframe")

// @function TODO: add function description here
// @param x TODO: add parameter x description here
// @returns TODO: add what function returns


////////////////////////////////////// TimeFrame Set //////////////////////////////////////////////////////
// big_interval = timeframe.period == "1" ? "5" : timeframe.period == "5" ? "30": timeframe.period == "15" ? "60" : timeframe.period == "30" ? "120" :timeframe.period == "60" ? "240" : timeframe.period == "240" ? "D" : timeframe.period == "D" ? "W" : "60"
// big_interval_2 = timeframe.period == "1" ? "30" : timeframe.period == "5" ? "120": timeframe.period == "15" ? "240" : timeframe.period == "30" ? "480" :timeframe.period == "60" ? "D" : timeframe.period == "240" ? "W" : timeframe.period == "D" ? "W" : "D"
// big_mult = timeframe.period == "1" ? 5 : timeframe.period == "5" ? 6: timeframe.period == "15" ? 4 : timeframe.period == "30" ? 4 :timeframe.period == "60" ? 4 : timeframe.period == "240" ? 6 : timeframe.period == "D" ? 7 : 7
// big_mult_2 = timeframe.period == "1" ? 30 : timeframe.period == "5" ? 24: timeframe.period == "15" ? 16 : timeframe.period == "30" ? 16 :timeframe.period == "60" ? 24 : timeframe.period == "240" ? 42 : timeframe.period == "D" ? 7 : 21
// big_interval = 5
// big_interval_2 = 30
// big_mult = 5
// big_mult_2 = 30

export MultTimeframes() =>
	//TODO : add function body and return value here
	big_interval = "5"
	big_interval_2 = "30"
	big_mult = 5
	big_mult_2 = 30

	// Second
	if timeframe.period == "1S"
		big_interval := "5S"
		big_interval_2 := "30S"
		big_mult := 5
		big_mult_2 := 30
	else if timeframe.period == "5S"
		big_interval := "30S"
		big_interval_2 := "4"
		big_mult := 6
		big_mult_2 := 24
	else if timeframe.period == "10S"
		big_interval := "1"
		big_interval_2 := "4"
		big_mult := 6
		big_mult_2 := 24
	else if timeframe.period == "15S"
		big_interval := "1"
		big_interval_2 := "4"
		big_mult := 4
		big_mult_2 := 16
	else if timeframe.period == "30S"
		big_interval := "2"
		big_interval_2 := "8"
		big_mult := 4
		big_mult_2 := 16

	// Minutes
	else if timeframe.period == "1"
		big_interval := "5"
		big_interval_2 := "30"
		big_mult := 5
		big_mult_2 := 30
	else if timeframe.period == "2"
		big_interval := "10"
		big_interval_2 := "60"
		big_mult := 5
		big_mult_2 := 30
	else if timeframe.period == "3"
		big_interval := "15"
		big_interval_2 := "90"
		big_mult := 5
		big_mult_2 := 30
	else if timeframe.period == "4"
		big_interval := "20"
		big_interval_2 := "120"
		big_mult := 5
		big_mult_2 := 30
	else if timeframe.period == "5"
		big_interval := "30"
		big_interval_2 := "120"
		big_mult := 6
		big_mult_2 := 24

	else if timeframe.period == "6"
		big_interval := "30"
		big_interval_2 := "120"
		big_mult := 5
		big_mult_2 := 20
	else if timeframe.period == "10"
		big_interval := "60"
		big_interval_2 := "240"
		big_mult := 6
		big_mult_2 := 24
	else if timeframe.period == "15"
		big_interval := "60"
		big_interval_2 := "240"
		big_mult := 4
		big_mult_2 := 16
	else if timeframe.period == "30"
		big_interval := "120"
		big_interval_2 := "480"
		big_mult := 4
		big_mult_2 := 16
	else if timeframe.period == "45"
		big_interval := "180"
		big_interval_2 := "450"
		big_mult := 4
		big_mult_2 := 10

	// Hours
	else if timeframe.period == "60"
		big_interval := "240"
		big_interval_2 := "D"
		big_mult := 4
		big_mult_2 := 24
	else if timeframe.period == "120"
		big_interval := "480"
		big_interval_2 := "2D"
		big_mult := 4
		big_mult_2 := 24
	else if timeframe.period == "180"
		big_interval := "720"
		big_interval_2 := "3D"
		big_mult := 4
		big_mult_2 := 24
	else if timeframe.period == "240"
		big_interval := "D"
		big_interval_2 := "W"
		big_mult := 6
		big_mult_2 := 42

	// Days
	else if timeframe.period == "D"
		big_interval := "W"
		big_interval_2 := "M"
		big_mult := 7
		big_mult_2 := 30

	else if timeframe.period == "W"
		big_interval := "M"
		big_interval_2 := "Y"
		big_mult := 4
		big_mult_2 := 48

	else
		big_interval := "5"
		big_interval_2 := "30"
		big_mult := 5
		big_mult_2 := 30

	[big_interval, big_interval_2, big_mult, big_mult_2]


