@traderdoc
Danke für den Tipp. Also die Bufferarrays hab ich gefunden.Die Pfeile sind an den Punkt gekettet das heisst man muss nur die eigentliche Indikatorberechnug (Punktberechnung) anpassen.
Aber ich weiss nicht wie so eine Zählerschleife aussieht die erkennt das die vorige Kerze ein Signal hatte?
Hier der Code der Berechnung der aber nicht die vorige Kerze miteinbezieht.
Code:
// ---
int start() {
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=MathMin(Bars-counted_bars,Bars-1);
for (int i = limit; i >=0; i--)
{
//double Temp = 0.0; for (int j = i; j < i + Per; j++) Temp += (High[j] + Low[j]) / 2.0;
//rsi:
double Main =iMA(NULL,0,Period,0,MaMethod,MaPrice,i) ;//Temp / Per;
// Temp = 0.0; for (j = i; j < i + Per; j++) Temp += High[j] - Low[j];
double Minr = 0.2 * iATR(NULL,0,Period,i);//(Temp / Per);
if (Minr!=0)
{
AboveBuff[i] = 3.0 * (High[i] - Main) / Minr;
BelowBuff[i] = 3.0 * (Low[i] - Main) / Minr;
}
ShortBuff[i] = EMPTY_VALUE;
LongBuff[i] = EMPTY_VALUE;
if (AboveBuff[i] > Level) {ShortBuff[i] = Level+1; DrawArrow(prefix+Time[i],"SELL",i,"down");}
if (BelowBuff[i] < -Level) {LongBuff[i] = -(Level+1); DrawArrow(prefix+Time[i],"BUY",i,"up");}
}
manageAlerts();
return(0);
}
//+-------------------------------------------------------------------
void manageAlerts()
{
if (alertsOn)
{
if (alertsOnCurrent)
int whichBar = 0;
else whichBar = 1;
if (ShortBuff[whichBar] != EMPTY_VALUE || LongBuff[whichBar] != EMPTY_VALUE)
{
if (ShortBuff[whichBar] != EMPTY_VALUE==OP_SELL)
{
if(Bars!=act_bars){
doAlert(whichBar,"down");
act_bars=Bars;}
}
if (LongBuff[whichBar] != EMPTY_VALUE==OP_BUY)
{
if(Bars!=act_bars){
doAlert(whichBar,"up");
act_bars=Bars;}
}
}
}
}