Kod: Zaznacz cały
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)!=EMPTY_VALUE)
//rob transakcje
Kod: Zaznacz cały
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)==EMPTY_VALUE)
//zamknij transakcje
Kod: Zaznacz cały
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)!=EMPTY_VALUE)
//rob transakcje
Kod: Zaznacz cały
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)==EMPTY_VALUE)
//zamknij transakcje
Wskaznik nie może miec równoczenie 2 wartości to po pierwsze.thisredone pisze:I przy testowaniu na historii często zdarza się, że jest transakcja jest zawierana i natychmiastowo zamykana. Jak więc wartość może być jednocześnie równa EMPTY_VALUE oraz nierówna EMPTY_VALUE ?
Kod: Zaznacz cały
else
Kod: Zaznacz cały
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)!=EMPTY_VALUE)
{
RefreshRates();
ticket=OrderSend(Symbol(), OP_BUY, lots, NormalizeDouble(Ask,4), 0, NormalizeDouble(Ask-stop_loss*Point,Digits), NormalizeDouble(Ask+take_profit*Point,Digits),"puf",16384,0,Green);
}
Kod: Zaznacz cały
if(OrdersTotal()!=0)
{
RefreshRates();
OrderSelect(ticket, SELECT_BY_TICKET);
if(OrderType()==OP_BUY)
{
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)==EMPTY_VALUE)
OrderClose(ticket,lots,NormalizeDouble(Bid,4),0,Red);
}
else
{
if(iCustom(NULL,0,"Slope Direction Line",15,3,0,0,0)!=EMPTY_VALUE)
OrderClose(ticket,lots,NormalizeDouble(Ask,4),0,Red);
}
}
Kod: Zaznacz cały
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(0, Uptrend);
//ArraySetAsSeries(Uptrend, true);
SetIndexBuffer(1, Dntrend);
//ArraySetAsSeries(Dntrend, true);
SetIndexBuffer(2, ExtMapBuffer);
ArraySetAsSeries(ExtMapBuffer, true);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
IndicatorShortName("Slope Direction Line("+period+")");
return(0);
}
Kod: Zaznacz cały
if (trend[x]>0)
{ Uptrend[x] = ExtMapBuffer[x];
if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1];
Dntrend[x] = EMPTY_VALUE;
}
else
if (trend[x]<0)
{
Dntrend[x] = ExtMapBuffer[x];
if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1];
Uptrend[x] = EMPTY_VALUE;
}