How can this be?
Code: Select all
protected override void Create(){
RSI = (Indicator.RSI)AddIndicator("RSI");
RsiF = new Function.RSI(this, 0);
///...
}
protected override void StartCalc() // assign inputs
{
RSI.length = 28;
RsiF.price = Bars.Close;
RsiF.length= 28;
}
protected override void CalcBar(){
R = Math.Round(RSI.Plots[0].Values[0],1);
Rf = Math.Round(RsiF.Value,1);
if (Rf < 60)
{
if(!LongLimitOn)//define price just once.
{
LongLimitOn=true;
P = Math.Round(Bars.Close[0]-20,0);
FlagTime = Bars.Time[0];
}
Output.WriteLine(Bars.Time[0] + " since "+ FlagTime + " sending @: "+P+" \tRSIf:" + Rf + " \tRSI:" + R+", Close="+Bars.Close[0]);
bLimit.Send("R<50@"+P +"/Openned "+FlagTime.ToShortTimeString() , P, 1);
}
}