I have currently loaded Data(1): 1min AUDCAD, Data(2) 20min AUDCAD
Plotting Studies is not an issue. I add the study to the format object screen and select the base data number and everything works as i want it to.
When it comes to Signals I cannot seem to get it to work.
Currently i am testing this with a 2line Moving average cross:
Code: Select all
inputs: Price(Close Data(2)), FastLength( 4 ), SlowLength( 75 );
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( price, FastLength ) ;
var1 = AverageFC( price, SlowLength ) ;
condition1 = CurrentBar > 1 and var0 crosses over var1 ;
if condition1 then
Buy ( "MA2CrossLE") next bar at market ;
Alert(Text("Averages crossed! BUY", var0, var1));
condition2 = CurrentBar > 1 and var0 crosses under var1 ;
if condition2 then
Sell Short ( "MA2CrossSE" ) next bar at market ;
Code: Select all
var0 = AverageFC( Close Data(2), FastLength ) ;
var1 = AverageFC( Close Data(2), SlowLength ) ;
as i expected, both of these codes yielded the same results.
If someone could point me in the right direction that would be great.
Some additional related questions:
- When multiple data series are loaded on same instrument with different timescales does the trading (ie: order placement) need to be done on data1?
- Can I have a moving average cross on data2 trigger an order a different timescale?