Is it possible to code a function to output a result based on a specific time frame?
For example:
Calculate FunctionA(1minute time frame) + FunctionA(2min) + FunctionA(5min) + ...
Any assistance would be appreciated.
Thanks.
Code a Function for specific time frame [SOLVED]
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Code a Function for specific time frame
I am not sure what you are looking for...Is it possible to code a function to output a result based on a specific time frame?
For example:
Calculate FunctionA(1minute time frame) + FunctionA(2min) + FunctionA(5min) + ...
Any assistance would be appreciated.
Thanks.
your example does not explain anything.
What do you mean by output? to an ascii file?
Can you give more specific detail/example?
Re: Code a Function for specific time frame
I apologize for the lack of detail.
I would like to calculate the following function for a 1 minute and 2 minute time frame, and
then plot the total (sum) onto a screener.
Example: Result of function BR_TrendDOWN(1 minute time frame) + Result of function BR_TrendDOWN(2 minute time frame) = 1+1 = 2. I would like to plot the result "2" onto a screener.
I would like to calculate the following function for a 1 minute and 2 minute time frame, and
then plot the total (sum) onto a screener.
Code: Select all
*** How would you specify a specific time frame for this function?
condition1 = High < High[1]
AND Low < Low[1]
AND High[1] < High[2]
AND Low[1] < Low[2];
If condition1 Then
BR_TrendDOWN= 1
Else
BR_TrendDOWN= 0;
- TJ
- Posts: 7742
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Code a Function for specific time frame [SOLVED]
The easiest way is to duplicate the logic and save them into a single indicator;I apologize for the lack of detail.
I would like to calculate the following function for a 1 minute and 2 minute time frame, and
then plot the total (sum) onto a screener.
::
Example: Result of function BR_TrendDOWN(1 minute time frame) + Result of function BR_TrendDOWN(2 minute time frame) = 1+1 = 2. I would like to plot the result "2" onto a screener.
set one logic for data1 (1 min) and the second logic for data2 (2 min).
eg.
Code: Select all
condition1 = (High < High[1]) data1;
condition2 = (High < High[1]) data2;
viewtopic.php?f=16&t=6929