trying to build a multi time frame strategy with RSI.
somehow the data2 doesn't act as it should be. data1 is ok.
that's mean if I try the strategy with only one of the time frames, just data1 (main chart) bring accurate results.
running only data2 show weird results' and both data1+data2 (as the code below) doesn't show anything.
2 RSI indicators attached to 2 sub-charts respectively.
1 tick resolution.
reading several earlier posts with the subject didn't help.
compile the strategy is OK.
the code I wrote:
Code: Select all
inputs: Price( Close ), Length( 14 ), OverSold( 30 ) ;
variables: RSI10(0), RSI20(0) ;
RSI10 = RSI(Price, 14 );
RSI20 = RSI(Close of data2, 14 );
condition1 = Currentbar > 1 and RSI10 < 0 and RSI20 < 0 ;
if condition1 then
Buy ( "RsiLE" ) this bar at close ;