# Useful Ideas

This document is for giving out some useful ideas which can be used while creating an app.

### Overview Useful Ideas
This app is to test some technical ways to render a variety of curves.

### Horizontal Line Horizontal Line
R1_high*0+1000
A horizontal line was created using the formula `R1_high*0+1000`. To obtain this line, 'R1_high' was first multiplied by zero, resulting in a constant value of zero for every data point. By adding 1,000 to this, a horizontal line with a constant y-value of 1000 was obtained.

### Linear Line Linear Line
cumulativeSum(R1_high*0+20)
The cumulativeSum function returns the sum of values from the beginning of a dataset up to the current time. When applied to the horizontal line formula-`R1_high*0+20`, it produces a linear line with the equation `y=20x`, where x represents the time axis. This is because the horizontal line provides a constant value of 20 for all data points, and the cumulativeSum function adds up these values over time, resulting in a linear increase of y-values proportional to the x-values.

### Periodic Line Periodic Line
sum(R1_high*0+100,7)
The periodic_sum function calculates the sum of a series of values "a" over a given period "p" ending at the current time. For example, the function "periodic_sum of 100 by period 7 sum(a, p)" calculates the sum of "a" over the past 7 periods and returns the value at the current time.
If this function is applied to a horizontal line like `R1_high*0+100`, it creates a periodic line that shows the sum of the values of R1_high over the past 7 periods. For instance, if R1_high is a daily candlestick data, then the periodic_sum of R1_high for a period of 7 would give the sum of R1_high over the past 7 days. The resulting line would show a linear increase from the beginning to the 7th period and remain horizontal elsewhere. The cumulativeSum function returns the sum of the value from the beginning to the time of the value. By applying it twice to a horizontal line, it generates a quadratic-like curve, resembling the shape of a parabola. This is because the first application creates a linear line, while the second application to that line further increases the slope, resulting in a curve that grows exponentially. Therefore, the resulting formula is `cumulativeSum(cumulativeSum(R1_high*0 + x))`. The log function calculates the logarithm of every value in the function formula using the base "e," which is the Euler constant. In this case, the function formula is `log(X^3)`, which means that the logarithm of the cube of every value of X is calculated. This results in a logarithmic curve that increases at a decreasing rate as the X values increase.