Time-frame and sample size option

Now that we're getting good at adding new options, let's add a few more! We're going to need to allow the user to change the time frame of data to consider, like 1 day or 1 week. Then we also want the user to be able to set the time length of each "bar" of open, high, low and close data (how much each "bar" or "Candlestick" will consider).

First, we need the variables:

resampleSize = "15Min"
DataPace = "1d"
candleWidth = 0.008

The resampleSize variable is for the time-frame of candlestick. The DataPace variable is how much data overall we're going to consider and show in the graph. Finally, the candleWidth variable is how wide the candlestick will be. The more candlesticks we have, the thinner they need to be so they don't overlap each other, the fewer we have the larger they should be.

Here, we turn DataPace into a global variable for the same reason as before. Next, we have a quick if-statement to check if there will be just way too much data to be reasonable. With 1 week of data, we'd have no reason to show 1 minute bars, as it would be way too much data to even consider (10,080 candles).

As long as there's no problem with the data set choices, we then change the DataPace to the tf parameter.