Unable to load assembly. Can not put indicator into cbot's file and vice versa.
Created at 15 May 2014, 15:38
WI
Unable to load assembly. Can not put indicator into cbot's file and vice versa.
15 May 2014, 15:38
I was modifying this indicator to show only one time period, but for some reason it throws this error after rebuilding it.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class Ichimoku_Kumo_Overlay : Indicator
{
[Parameter("Timeframe 1", DefaultValue = "Daily")]
public TimeFrame TF1 { get; set; }
public MarketSeries series1;
public MarketSeries series;
public IchimokuKinkoHyo cloud1;
public IchimokuKinkoHyo cloud;
public int ind = 1, currindex, pastindex;
public string[] PrC = new string[8];
public string[] KjC = new string[8];
public string[] ChC = new string[8];
public string[] PrK = new string[8];
public string[] ChK = new string[8];
public string[] TnK = new string[8];
public string[] ChP = new string[8];
public string[] Res = new string[8];
public string[] Space;
public string Line0 = "\n";
public TimeFrame _time;
public double Pr, spanA, spanB, kijun, Tenkan, Chikou, PastKijun, PastPrice, PastSpanA, PastspanB;
public Colors BullColor = Colors.DodgerBlue;
public Colors BearColor = Colors.Red;
public Colors NeutralColor = Colors.Yellow;
public Colors[] PrCColor = new Colors[8];
public Colors[] KjCColor = new Colors[8];
public Colors[] ChCColor = new Colors[8];
public Colors[] PrKColor = new Colors[8];
public Colors[] ChKColor = new Colors[8];
public Colors[] TnKColor = new Colors[8];
public Colors[] ChPColor = new Colors[8];
public string Bull = "UP";
public string Bear = "DN";
public string Neutral = "NT";
protected override void Initialize()
{
series1 = MarketData.GetSeries(TF1);
cloud1 = Indicators.IchimokuKinkoHyo(series1, 9, 26, 52);
}
public override void Calculate(int index)
{
string LAB0 = string.Format("{0,0}", "------------------------Cloud-----------------KijunSen--------Past Price---");
string LAB1 = string.Format("\n{0,-65}", "Pr");
string LAB2 = string.Format("\n{0,-45}", "Kj");
string LAB3 = string.Format("\n{0,-25}", "Ch");
string LAB4 = string.Format("\n{0,15}", "Pr");
string LAB5 = string.Format("\n{0,35}", "Ch");
string LAB6 = string.Format("\n{0,55}", "Tn");
string LAB7 = string.Format("\n{0,85}", "Ch");
string LAB8 = string.Format("\n\n\n\n\n\n\n\n\n\n{0,-60}", "Pr: Price, Kj: KijunSen, Ch: Chikou, Tn: TenkanSen");
ChartObjects.DrawText("LABEL0", LAB0, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL1", LAB1, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL2", LAB2, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL3", LAB3, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL4", LAB4, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL5", LAB5, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL6", LAB6, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL7", LAB7, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("LABEL8", LAB8, StaticPosition.TopCenter, Colors.White);
string tfLAB0 = string.Format("\n{0,-105}", "Component");
string tfLAB1 = string.Format("\n\n{0,-100}", TF1);
ChartObjects.DrawText("tfLABEL0", tfLAB0, StaticPosition.TopCenter, Colors.White);
ChartObjects.DrawText("tfLABEL1", tfLAB1, StaticPosition.TopCenter, Colors.White);
for (int i = 0; i < 8; i++)
{
switch (i)
{
case 0:
currindex = series1.Close.Count - ind;
pastindex = currindex - 26;
Pr = series1.Close[currindex];
spanA = cloud1.SenkouSpanA[currindex];
spanB = cloud1.SenkouSpanB[currindex];
kijun = cloud1.KijunSen[currindex];
Tenkan = cloud1.TenkanSen[currindex];
Chikou = cloud1.ChikouSpan[pastindex];
PastKijun = cloud1.KijunSen[pastindex];
PastPrice = series1.Close[pastindex];
PastSpanA = cloud1.SenkouSpanA[pastindex];
PastspanB = cloud1.SenkouSpanB[pastindex];
break;
}
//Price compared to Cloud
if (Pr < spanA && Pr < spanB)
{
PrC[i] = string.Format("{0,-65}", Bear);
PrCColor[i] = BearColor;
}
else if (Pr > spanA && Pr > spanB)
{
PrC[i] = string.Format("{0,-65}", Bull);
PrCColor[i] = BullColor;
}
else
{
PrC[i] = string.Format("{0,-65}", Neutral);
PrCColor[i] = NeutralColor;
}
//KijunSen compared to Cloud
if (kijun < spanA && kijun < spanB)
{
KjC[i] = string.Format("{0,-45}", Bear);
KjCColor[i] = BearColor;
}
else if (kijun > spanA && kijun > spanB)
{
KjC[i] = string.Format("{0,-45}", Bull);
KjCColor[i] = BullColor;
}
else
{
KjC[i] = string.Format("{0,-45}", Neutral);
KjCColor[i] = NeutralColor;
}
//ChikouSpan compared to Cloud
if (Chikou < PastSpanA && Chikou < PastspanB)
{
ChC[i] = string.Format("{0,-25}", Bear);
ChCColor[i] = BearColor;
}
else if (Chikou > PastSpanA && Chikou > PastspanB)
{
ChC[i] = string.Format("{0,-25}", Bull);
ChCColor[i] = BullColor;
}
else
{
ChC[i] = string.Format("{0,-25}", Neutral);
ChCColor[i] = NeutralColor;
}
//Price compared to KijunSen
if (Pr < kijun)
{
PrK[i] = string.Format("{0,15}", Bear);
PrKColor[i] = BearColor;
}
else if (Pr > kijun)
{
PrK[i] = string.Format("{0,15}", Bull);
PrKColor[i] = BullColor;
}
else
{
PrK[i] = string.Format("{0,15}", Neutral);
PrKColor[i] = NeutralColor;
}
//ChikouSpan compared to Past KijunSen
if (Chikou < PastKijun)
{
ChK[i] = string.Format("{0,35}", Bear);
ChKColor[i] = BearColor;
}
else if (Chikou > PastKijun)
{
ChK[i] = string.Format("{0,35}", Bull);
ChKColor[i] = BullColor;
}
else
{
ChK[i] = string.Format("{0,35}", Neutral);
ChKColor[i] = NeutralColor;
}
//TenkanSen compared to Past KijunSen
if (Tenkan < kijun)
{
TnK[i] = string.Format("{0,55}", Bear);
TnKColor[i] = BearColor;
}
else if (Tenkan > kijun)
{
TnK[i] = string.Format("{0,55}", Bull);
TnKColor[i] = BullColor;
}
else
{
TnK[i] = string.Format("{0,55}", Neutral);
TnKColor[i] = NeutralColor;
}
//ChikouSpan compared to Past Price
if (Chikou < PastPrice)
{
ChP[i] = string.Format("{0,85}", Bear);
ChPColor[i] = BearColor;
}
else if (Chikou > PastPrice)
{
ChP[i] = string.Format("{0,85}", Bull);
ChPColor[i] = BullColor;
}
else
{
ChP[i] = string.Format("{0,85}", Neutral);
ChPColor[i] = NeutralColor;
}
}
}
}
}
Any help would be greatly appreciated

Spotware
15 May 2014, 17:48
You need to move your indicator from
Documents\cAlgo\Sources\Robots folder
to
Documents\cAlgo\Sources\Indicators folder.
@Spotware