Code: Select all
inputs:
close1(close of data1),
close2(close of data2),
fastma(13),
slowma(26);
variables:
fma(0),
sma(0),
fma2(0),
sma2(0);
fma = XAverage(close1, fastma);
sma = XAverage(close1, slowma);
fma2 = XAverage(close2, fastma);
sma2 = XAverage(close2, slowma);
I also have the respective EMA 13 and 26 indicators visible on each of the charts (Moving Average Exponential).
Further, I have this as an entry signal:
Code: Select all
if marketposition = 0 and (fma2 > sma2) then begin
if (close1 > fma) and (fma > sma) then begin
print (close1, fma, sma, " :", close2, fma2, sma2, " :", fma2[1], sma2[1]);
buy("op") next bar at market;
end;
end;
I am using IQFeed and MC 9.0, the latest release/patch.
Can someone give me some clues as to why this isn't working as expected?
Thanks much!