Merhaba ben > işleminden cross işlemine almak istiyorum crossabove(vma,vma2) gibi ama beceremedim ekteki resimdeki hatayı veriyor bunu nasıl düzeltebilirim? Formülüm aşağıda inceler misiniz lütfen?
public class TeleBot : Explorer
{
[Parameter(21)]
public int VmaPeriod1;
[Parameter(55)]
public int VmaPeriod2;
[Parameter(3)]
public int BarSayisi;
VMA vma;
VMA vma2;
[Parameter(1)]
public decimal Alphatrend_iqCoeff1;
[Parameter(14)]
public int Alphatrend_iqPeriod1;
[Parameter(Momentum.MFI)]
public Momentum Alphatrend_iqMomentum1;
MatriksIndicator AlphaTrend_IQ;
public static string str;
public static List<string> GuncelListe = new List<string>();
private static readonly object Lock = new object();
public override void OnInit()
{
vma = VMAIndicator(Symbol, SymbolPeriod, OHLCType.Close, VmaPeriod1);
vma2 = VMAIndicator(Symbol, SymbolPeriod, OHLCType.Close, VmaPeriod2);
AddColumns(0);
AddColumns(2);
SetColumnText(0, "Trend");
SetColumnText(1, "Kapanis");
AlphaTrend_IQ = new AlphaTrend_IQ();
AlphaTrend_IQ.SetIndicatorParameters("Coeff", Alphatrend_iqCoeff1);
AlphaTrend_IQ.SetIndicatorParameters("Period", Alphatrend_iqPeriod1);
AlphaTrend_IQ.SetIndicatorParameters("Momentum", Alphatrend_iqMomentum1); RegisterUserIndicator(AlphaTrend_IQ, Symbol, SymbolPeriod, OHLCType.Close, 5);
}
bool result = false;
public override bool OnExplorer(List<BarDataEventArgs> bardatas)
{
var barData1 = GetBarData(Symbol, SymbolPeriod);
var close = bardatas.FirstOrDefault().BarData.Close;
var zaman = DateTime.Now;
for (int i = 1; i<BarSayisi; i++)
if (CrossBelow(AlphaTrend_IQ, barData1, OHLCType.Low, 0) && CrossAbove(vma.Value[0][vma.CurrentIndex - i], vma2.Value[0][vma2.CurrentIndex - i],0,0))
{
TelegramBot.SendMessage(" Alpha : $" + Symbol + Environment.NewLine + Environment.NewLine + "__Periyot: " + SymbolPeriod + "__" + Environment.NewLine + Environment.NewLine
+ Environment.NewLine + "Anlık Fiyat : " + close + "__" + Environment.NewLine + Environment.NewLine + Environment.NewLine + "Saat : " + zaman);
}
return result;
}
public override void OnExplorerFinished()
{
try
{
StringBuilder sBuilder = new StringBuilder();
GuncelListe.Sort();
foreach (var deger in GuncelListe)
{
sBuilder.AppendLine(deger);
}
TelegramBot.SendMessage(sBuilder.ToString());
}catch (Exception exp)
{
}
}
}
}