Wszystkie pytania dozwolone początkujących programistów
Re: Wszystkie pytania dozwolone początkujących programistów
Czy jest możliwość "wyciągnięcia" jakie było saldo o określonej dacie i czasie? W OrdersHistory wydaje mi się, że tego nie widzę.
Re: Wszystkie pytania dozwolone początkujących programistów
W jaki sposób można utworzyć tablicę nie wiedząc jaki ma mieć rozmiar? W trakcie przeszukiwania danych ma tylko wybrane zapisywać w tablicy i nie wiem np. czy ma mieć rozmiar 2 czy 50. Chodzi o to aby dynamicznie się powiększała jeśli pojawią się kolejne dane do zapisania.
Re: Wszystkie pytania dozwolone początkujących programistów
Podczas tworzenia możesz określić wstępny rozmiar tablicy np.
W trakcie wykonywania kodu możesz określić warunek i powiększać tą tablicę poleceniem :
gdzie 20 to nowy rozmiar tablicy.
Kod: Zaznacz cały
double tablica[10];
Kod: Zaznacz cały
ArrayResize(tablica,20);
gdzie 20 to nowy rozmiar tablicy.
Solą życia jest kasa.
-
- Uczestnik
- Posty: 1
- Rejestracja: 11 wrz 2024, 20:08
Re: Wszystkie pytania dozwolone początkujących programistów
Dzień dobry, cześć witam.
Nie będę ukrywał, że nie jestem programistom wiec proszę nie linczujcie za mocno
Mianowicie szukam osoby która zna się na programowaniu w MetaTrader5 czyli to chyba MQL?
Sytuacja wygląda następująco, potrzebuję do swojego projektu najprostszego kodu do najprostszej siatki zleceń i to chyba nazywa się dokładnie Grid BOT.
Chat GPT (nie bijcie ) napisał mi kilka razy cos i pozniej poprawial bo wyskakiwaly mi błędy podczas testowania w Meta Trader Strategy Tester Agent, finalnie jest coś nie tak tylko w jednym miejscu a dokładniej tutaj:
-'Buy' - wrong parameters count BOT BTC FULL.mq5 57 16
a tutaj jest ten fragment kodu:
// Wysyłanie zlecenia kupna
trade.Buy(LotSize, _Symbol, price, sl, tp, "", 0, 0, clrNONE);
Rozumiem tyle że coś jest nie tak z tym buy, powinna byc jakas inna forma, proszę pomocy to *tylko jedno słowo w kodzie
Nie będę ukrywał, że nie jestem programistom wiec proszę nie linczujcie za mocno
Mianowicie szukam osoby która zna się na programowaniu w MetaTrader5 czyli to chyba MQL?
Sytuacja wygląda następująco, potrzebuję do swojego projektu najprostszego kodu do najprostszej siatki zleceń i to chyba nazywa się dokładnie Grid BOT.
Chat GPT (nie bijcie ) napisał mi kilka razy cos i pozniej poprawial bo wyskakiwaly mi błędy podczas testowania w Meta Trader Strategy Tester Agent, finalnie jest coś nie tak tylko w jednym miejscu a dokładniej tutaj:
-'Buy' - wrong parameters count BOT BTC FULL.mq5 57 16
a tutaj jest ten fragment kodu:
// Wysyłanie zlecenia kupna
trade.Buy(LotSize, _Symbol, price, sl, tp, "", 0, 0, clrNONE);
Rozumiem tyle że coś jest nie tak z tym buy, powinna byc jakas inna forma, proszę pomocy to *tylko jedno słowo w kodzie
Re: Wszystkie pytania dozwolone początkujących programistów
Wydaje się, że coś jest nie tak z LotSize. LotSize jest stałą wartością czy jest obliczany przez EA?
Re: Wszystkie pytania dozwolone początkujących programistów
Czy ktoś może mi wskazać kierunek, gdzie mam szukać odpowiedzi?
Chodzi o okno danych w MT4, które dla wskaźnika HalfTrend pokazuje mi wartości z dokładnością do 4 miejsc po przecinku.
Znormalizowałem zmienne typu Double do wartości Digits() i nadal mam wartości do czterech miejsc po przecinku.
Gdzie szukać rozwiązania?
Zamieszczam zmodyfikowany kod.
Możliwe, że jeszcze coś przeoczyłem...
Chodzi o okno danych w MT4, które dla wskaźnika HalfTrend pokazuje mi wartości z dokładnością do 4 miejsc po przecinku.
Znormalizowałem zmienne typu Double do wartości Digits() i nadal mam wartości do czterech miejsc po przecinku.
Gdzie szukać rozwiązania?
Zamieszczam zmodyfikowany kod.
Możliwe, że jeszcze coś przeoczyłem...
Kod: Zaznacz cały
//+----------------------------------------------------------------------+
//| HalfTrend.mq4 |
//+----------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 DodgerBlue // up[]
#property indicator_width1 3
#property indicator_color2 Red // down[]
#property indicator_width2 3
#property indicator_color3 DodgerBlue // atrlo[]
#property indicator_width3 1
#property indicator_color4 Red // atrhi[]
#property indicator_width4 1
#property indicator_color5 DodgerBlue // arrup[]
#property indicator_width5 2
#property indicator_color6 Red // arrdwn[]
#property indicator_width6 2
extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT;
extern int Amplitude = 2.0;
extern bool alertsOn = true;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = true;
extern bool alertsNotification = true;//false;
extern bool alertsSound = true;
extern bool alertsEmail = false;
extern bool ShowBars = false;//true;
extern bool ShowArrows = true;
extern int arrowSize = 2;
extern int uparrowCode = 233;
extern int dnarrowCode = 234;
extern bool ArrowsOnFirstBar = true;
double up[],down[],atrlo[],atrhi[],trend[];
double arrup[],arrdwn[];
//
//
//
//
//
string indicatorFileName;
bool returnBars;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(7); // +1 buffer - trend[]
SetIndexBuffer(0,up);
SetIndexBuffer(1,down);
SetIndexBuffer(2,atrlo);
SetIndexBuffer(3,atrhi);
SetIndexBuffer(4,arrup);
SetIndexBuffer(5,arrdwn);
SetIndexBuffer(6,trend);
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(6,0.0);
if(ShowBars)
{
SetIndexStyle(2,DRAW_HISTOGRAM, STYLE_SOLID);
SetIndexStyle(3,DRAW_HISTOGRAM, STYLE_SOLID);
}
else
{
SetIndexStyle(2,DRAW_NONE);
SetIndexStyle(3,DRAW_NONE);
}
if (ShowArrows)
{
SetIndexStyle(4,DRAW_ARROW,0,arrowSize); SetIndexArrow(4,uparrowCode);
SetIndexStyle(5,DRAW_ARROW,0,arrowSize); SetIndexArrow(5,dnarrowCode);
}
else
{
SetIndexStyle(4,DRAW_NONE);
SetIndexStyle(5,DRAW_NONE);
}
indicatorFileName = WindowExpertName();
returnBars = TimeFrame == -99;
TimeFrame = MathMax(TimeFrame,_Period);
return (0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
class CFix { } ExtFix;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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);
if (returnBars) { up[0] = limit+1; return(0); }
if (TimeFrame!=Period())
{
int shift = -1; if (ArrowsOnFirstBar) shift=1;
limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,TimeFrame,indicatorFileName,-99,0,0)*TimeFrame/Period()));
for (int i=limit; i>=0; i--)
{
int y = iBarShift(NULL,TimeFrame,Time[i]);
int x = iBarShift(NULL,TimeFrame,Time[i+shift]);
up[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,0,y), Digits);
down[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,1,y), Digits);
atrlo[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,2,y), Digits);
atrhi[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,3,y), Digits);
if(x!=y)
{
arrup[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,4,y), Digits);
arrdwn[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,5,y), Digits);
}
else
{
arrup[i] = EMPTY_VALUE;
arrdwn[i] = EMPTY_VALUE;
}
}
return(0);
}
double atr,lowprice_i,highprice_i,lowma,highma;
int workbar=0;
double nexttrend=0,maxlowprice=Low[Bars-1],minhighprice=High[Bars-1];
for(i=Bars-1; i>=0; i--)
{
lowprice_i=NormalizeDouble(iLow(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_LOW,Amplitude,i)), Digits);
highprice_i=NormalizeDouble(iHigh(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_HIGH,Amplitude,i)), Digits);
lowma=NormalizeDouble(iMA(NULL,0,Amplitude,0,MODE_SMA,PRICE_LOW,i),Digits());
highma=NormalizeDouble(iMA(NULL,0,Amplitude,0,MODE_SMA,PRICE_HIGH,i),Digits());
trend[i]=trend[i+1];
atr=NormalizeDouble(iATR(Symbol(),0,100,i)/2, Digits);
arrup[i] = EMPTY_VALUE;
arrdwn[i] = EMPTY_VALUE;
if(nexttrend==1)
{
maxlowprice=NormalizeDouble(MathMax(lowprice_i,maxlowprice), Digits);
if(highma<maxlowprice && Close[i]<Low[i+1])
{
trend[i]=1.0;
nexttrend=0;
minhighprice=highprice_i;
}
}
if(nexttrend==0)
{
minhighprice=MathMin(highprice_i,minhighprice);
if(lowma>minhighprice && Close[i]>High[i+1])
{
trend[i]=0.0;
nexttrend=1;
maxlowprice=lowprice_i;
}
}
if(trend[i]==0.0)
{
if(trend[i+1]!=0.0)
{
up[i]=NormalizeDouble(down[i+1], Digits);
up[i+1]=NormalizeDouble(up[i], Digits);
arrup[i] = up[i] - 2*atr;
}
else
{
up[i] = NormalizeDouble(MathMax(maxlowprice, up[i+1]), Digits());
}
atrhi[i] = NormalizeDouble(up[i] - atr, Digits);
atrlo[i] = NormalizeDouble(up[i], Digits);
down[i]=0.0;
}
else
{
if(trend[i+1]!=1.0)
{
down[i]=NormalizeDouble(up[i+1], Digits);
down[i+1]=NormalizeDouble(down[i], Digits);
arrdwn[i] = NormalizeDouble((down[i] + 2*atr), Digits);
}
else
{
down[i] = NormalizeDouble(MathMin(minhighprice, down[i+1]), Digits());
}
atrhi[i] = NormalizeDouble(down[i] + atr, Digits());
atrlo[i] = NormalizeDouble(down[i], Digits());
up[i]=0.0;
}
}
manageAlerts();
return (0);
}
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//
//
//
//
//
string sTfTable[] = {"M1","M5","M10","M15","M30","H1","H4","D1","W1","MN"};
int iTfTable[] = {1,5,10,15,30,60,240,1440,10080,43200};
string timeFrameToString(int tf)
{
for (int i=ArraySize(iTfTable)-1; i>=0; i--)
if (tf==iTfTable[i]) return(sTfTable[i]);
return("");
}
//+-------------------------------------------------------------------
//|
//+-------------------------------------------------------------------
//
//
//
//
//
void manageAlerts()
{
if (alertsOn)
{
if (alertsOnCurrent)
int whichBar = 0;
else whichBar = 1;
if (arrup[whichBar] != EMPTY_VALUE) doAlert(whichBar,"up");
if (arrdwn[whichBar] != EMPTY_VALUE) doAlert(whichBar,"down");
}
}
//
//
//
//
//
void doAlert(int forBar, string doWhat)
{
static string previousAlert="nothing";
static datetime previousTime;
string message;
if (previousAlert != doWhat || previousTime != Time[forBar]) {
previousAlert = doWhat;
previousTime = Time[forBar];
//
//
//
//
//
message = StringConcatenate(Symbol()," ",timeFrameToString(_Period)," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," HalfTrend ",doWhat);
if (alertsMessage) Alert(message);
if (alertsEmail) SendMail(StringConcatenate(Symbol(),"HalfTrend "),message);
if (alertsNotification) SendNotification(message);
if (alertsSound) PlaySound("alert2.wav");
}
}
Re: Wszystkie pytania dozwolone początkujących programistów
Czy ktoś może mi wskazać kierunek, gdzie mam szukać odpowiedzi?
Chodzi o okno danych w MT4, które dla wskaźnika HalfTrend pokazuje mi wartości z dokładnością do 4 miejsc po przecinku.
Znormalizowałem zmienne typu Double do wartości Digits() i nadal mam wartości do czterech miejsc po przecinku.
Gdzie szukać rozwiązania?
Zamieszczam zmodyfikowany kod.
Możliwe, że jeszcze coś przeoczyłem...
Chodzi o okno danych w MT4, które dla wskaźnika HalfTrend pokazuje mi wartości z dokładnością do 4 miejsc po przecinku.
Znormalizowałem zmienne typu Double do wartości Digits() i nadal mam wartości do czterech miejsc po przecinku.
Gdzie szukać rozwiązania?
Zamieszczam zmodyfikowany kod.
Możliwe, że jeszcze coś przeoczyłem...
Kod: Zaznacz cały
//+----------------------------------------------------------------------+
//| HalfTrend.mq4 |
//+----------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 DodgerBlue // up[]
#property indicator_width1 3
#property indicator_color2 Red // down[]
#property indicator_width2 3
#property indicator_color3 DodgerBlue // atrlo[]
#property indicator_width3 1
#property indicator_color4 Red // atrhi[]
#property indicator_width4 1
#property indicator_color5 DodgerBlue // arrup[]
#property indicator_width5 2
#property indicator_color6 Red // arrdwn[]
#property indicator_width6 2
extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT;
extern int Amplitude = 2.0;
extern bool alertsOn = true;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = true;
extern bool alertsNotification = true;//false;
extern bool alertsSound = true;
extern bool alertsEmail = false;
extern bool ShowBars = false;//true;
extern bool ShowArrows = true;
extern int arrowSize = 2;
extern int uparrowCode = 233;
extern int dnarrowCode = 234;
extern bool ArrowsOnFirstBar = true;
double up[],down[],atrlo[],atrhi[],trend[];
double arrup[],arrdwn[];
//
//
//
//
//
string indicatorFileName;
bool returnBars;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(7); // +1 buffer - trend[]
SetIndexBuffer(0,up);
SetIndexBuffer(1,down);
SetIndexBuffer(2,atrlo);
SetIndexBuffer(3,atrhi);
SetIndexBuffer(4,arrup);
SetIndexBuffer(5,arrdwn);
SetIndexBuffer(6,trend);
SetIndexEmptyValue(0,0.0);
SetIndexEmptyValue(1,0.0);
SetIndexEmptyValue(6,0.0);
if(ShowBars)
{
SetIndexStyle(2,DRAW_HISTOGRAM, STYLE_SOLID);
SetIndexStyle(3,DRAW_HISTOGRAM, STYLE_SOLID);
}
else
{
SetIndexStyle(2,DRAW_NONE);
SetIndexStyle(3,DRAW_NONE);
}
if (ShowArrows)
{
SetIndexStyle(4,DRAW_ARROW,0,arrowSize); SetIndexArrow(4,uparrowCode);
SetIndexStyle(5,DRAW_ARROW,0,arrowSize); SetIndexArrow(5,dnarrowCode);
}
else
{
SetIndexStyle(4,DRAW_NONE);
SetIndexStyle(5,DRAW_NONE);
}
indicatorFileName = WindowExpertName();
returnBars = TimeFrame == -99;
TimeFrame = MathMax(TimeFrame,_Period);
return (0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
class CFix { } ExtFix;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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);
if (returnBars) { up[0] = limit+1; return(0); }
if (TimeFrame!=Period())
{
int shift = -1; if (ArrowsOnFirstBar) shift=1;
limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,TimeFrame,indicatorFileName,-99,0,0)*TimeFrame/Period()));
for (int i=limit; i>=0; i--)
{
int y = iBarShift(NULL,TimeFrame,Time[i]);
int x = iBarShift(NULL,TimeFrame,Time[i+shift]);
up[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,0,y), Digits);
down[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,1,y), Digits);
atrlo[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,2,y), Digits);
atrhi[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,3,y), Digits);
if(x!=y)
{
arrup[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,4,y), Digits);
arrdwn[i] = NormalizeDouble(iCustom(NULL,TimeFrame,indicatorFileName,PERIOD_CURRENT,Amplitude,alertsOn,alertsOnCurrent,alertsMessage,alertsNotification,alertsSound,alertsEmail,5,y), Digits);
}
else
{
arrup[i] = EMPTY_VALUE;
arrdwn[i] = EMPTY_VALUE;
}
}
return(0);
}
double atr,lowprice_i,highprice_i,lowma,highma;
int workbar=0;
double nexttrend=0,maxlowprice=Low[Bars-1],minhighprice=High[Bars-1];
for(i=Bars-1; i>=0; i--)
{
lowprice_i=NormalizeDouble(iLow(Symbol(),Period(),iLowest(Symbol(),Period(),MODE_LOW,Amplitude,i)), Digits);
highprice_i=NormalizeDouble(iHigh(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_HIGH,Amplitude,i)), Digits);
lowma=NormalizeDouble(iMA(NULL,0,Amplitude,0,MODE_SMA,PRICE_LOW,i),Digits());
highma=NormalizeDouble(iMA(NULL,0,Amplitude,0,MODE_SMA,PRICE_HIGH,i),Digits());
trend[i]=trend[i+1];
atr=NormalizeDouble(iATR(Symbol(),0,100,i)/2, Digits);
arrup[i] = EMPTY_VALUE;
arrdwn[i] = EMPTY_VALUE;
if(nexttrend==1)
{
maxlowprice=NormalizeDouble(MathMax(lowprice_i,maxlowprice), Digits);
if(highma<maxlowprice && Close[i]<Low[i+1])
{
trend[i]=1.0;
nexttrend=0;
minhighprice=highprice_i;
}
}
if(nexttrend==0)
{
minhighprice=MathMin(highprice_i,minhighprice);
if(lowma>minhighprice && Close[i]>High[i+1])
{
trend[i]=0.0;
nexttrend=1;
maxlowprice=lowprice_i;
}
}
if(trend[i]==0.0)
{
if(trend[i+1]!=0.0)
{
up[i]=NormalizeDouble(down[i+1], Digits);
up[i+1]=NormalizeDouble(up[i], Digits);
arrup[i] = up[i] - 2*atr;
}
else
{
up[i] = NormalizeDouble(MathMax(maxlowprice, up[i+1]), Digits());
}
atrhi[i] = NormalizeDouble(up[i] - atr, Digits);
atrlo[i] = NormalizeDouble(up[i], Digits);
down[i]=0.0;
}
else
{
if(trend[i+1]!=1.0)
{
down[i]=NormalizeDouble(up[i+1], Digits);
down[i+1]=NormalizeDouble(down[i], Digits);
arrdwn[i] = NormalizeDouble((down[i] + 2*atr), Digits);
}
else
{
down[i] = NormalizeDouble(MathMin(minhighprice, down[i+1]), Digits());
}
atrhi[i] = NormalizeDouble(down[i] + atr, Digits());
atrlo[i] = NormalizeDouble(down[i], Digits());
up[i]=0.0;
}
}
manageAlerts();
return (0);
}
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//
//
//
//
//
string sTfTable[] = {"M1","M5","M10","M15","M30","H1","H4","D1","W1","MN"};
int iTfTable[] = {1,5,10,15,30,60,240,1440,10080,43200};
string timeFrameToString(int tf)
{
for (int i=ArraySize(iTfTable)-1; i>=0; i--)
if (tf==iTfTable[i]) return(sTfTable[i]);
return("");
}
//+-------------------------------------------------------------------
//|
//+-------------------------------------------------------------------
//
//
//
//
//
void manageAlerts()
{
if (alertsOn)
{
if (alertsOnCurrent)
int whichBar = 0;
else whichBar = 1;
if (arrup[whichBar] != EMPTY_VALUE) doAlert(whichBar,"up");
if (arrdwn[whichBar] != EMPTY_VALUE) doAlert(whichBar,"down");
}
}
//
//
//
//
//
void doAlert(int forBar, string doWhat)
{
static string previousAlert="nothing";
static datetime previousTime;
string message;
if (previousAlert != doWhat || previousTime != Time[forBar]) {
previousAlert = doWhat;
previousTime = Time[forBar];
//
//
//
//
//
message = StringConcatenate(Symbol()," ",timeFrameToString(_Period)," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," HalfTrend ",doWhat);
if (alertsMessage) Alert(message);
if (alertsEmail) SendMail(StringConcatenate(Symbol(),"HalfTrend "),message);
if (alertsNotification) SendNotification(message);
if (alertsSound) PlaySound("alert2.wav");
}
}