ara1
1
I am trying to create variable in a time compreesed time frame.
Am not sure what the correct way is
Example:
TradeVariable = MACDslope > 0 and rsislope > 0 ;
Which approach below is correct?
First approach
Close_TF3x = TimeframeSet(Close,3indaily);
MACD1 = MACD(Close_TF3x, 12,26);
RSI1 = RSIa(Close_TF3x, 14);
MACDslope = MACD1 - ref(MACD1,-1);
rsislope = RSI1 - ref(RSI1,-1);
//
TradeVariable_TF3x = MACDslope > 0 and rsislope > 0;
TradeVariable_exp = Tameframeexpand(3inDaily);
//
//
Second approach
TradeVariable = MACDslope > 0 and rsislope > 0;
TradeVariable_TF3x = TimeFrameSet(TradeVariable, 3inDaily);
TradeVariable_exp = Tameframeexpand(3inDaily);
Is either or both correct
Thanks in advance
Tomasz
2
First of all, when posting the formula, please make sure that you use Code Tags (using </>
code button) as explained here: How to use this site.

Code tags are required so formulas can be properly displayed and copied without errors.
Please follow the Users' Guide Multiple Time Frame support
Neither of your code is correct. TimeFrameSet does NOT return any value.
TimeFrameSet compresses OHLC arrays as precisely described in the manual.
Correct usage (with examples) of TimeFramSet is explained in the manual.
TimeFrameSet( 3 * inDaily );
MACD1 = MACD( 12,26);
RSI1 = RSI( 14);
MACDslope = MACD1 - ref(MACD1,-1);
rsislope = RSI1 - ref(RSI1,-1);
TradeVariable_TF3x = MACDslope > 0 and rsislope > 0;
TimeFrameRestore();
TradeVariable_TF3x = TimeFrameExpand( TradeVariable_TF3x , 3 * inDaily );
2 Likes