Indicators with alerts/signal - page 1267

Mladen Rakic
154349
Mladen Rakic  
lizmerrill:
Re this statement from an indicator:

if (soundAlerts) Alert("Long trade at " + Symbol() + "! Stop Loss at " + ld_16);

how do I change this statement to short the last price like this:if (soundAlerts) Alert("Long trade at LASTPRICE " + Symbol() + "! Stop Loss at " + ld_16);

how do I rewrite this statement to show lastprice, so that whenever a signal occurs, and the alert is printed it will show "long trade at LAST + Symbol etc?

Add DoubleToStr(ThePiceToAlert) in that line

andrich
33
andrich  

Hi guys,

could you please make the alert for the reversals, on the first darker bar after the brighter ones?

UCS oscillator - general & alerts.mq4

femi
33
femi  

i want to know more about volume indicator and how to use it please

Mladen Rakic
154349
Mladen Rakic  
femi:
i want to know more about volume indicator and how to use it please

femi

You can check this thread https://www.mql5.com/en/forum/177158 for start

liz merrill
78
liz merrill  

mLaden, re this:

how do I change this statement to short the last price like this:if (soundAlerts) Alert("Long trade at LASTPRICE " + Symbol() + "! Stop Loss at " + ld_16);

how do I rewrite this statement to show lastprice, so that whenever a signal occurs, and the alert is printed it will show "long trade at LAST + Symbol etc?

You said, Add DoubleToStr(ThePiceToAlert) in that line, so is below correct?

if (soundAlerts) Alert("Long trade at " + DoubleToStr(Mode_Close) + Symbol() + "! Stop Loss at " + ld_16);

Not sure how to reference the last price other than Mode_Close, help, Thanks

Mladen Rakic
154349
Mladen Rakic  
lizmerrill:
mLaden, re this:

how do I change this statement to short the last price like this:if (soundAlerts) Alert("Long trade at LASTPRICE " + Symbol() + "! Stop Loss at " + ld_16);

how do I rewrite this statement to show lastprice, so that whenever a signal occurs, and the alert is printed it will show "long trade at LAST + Symbol etc?

You said, Add DoubleToStr(ThePiceToAlert) in that line, so is below correct?

if (soundAlerts) Alert("Long trade at " + DoubleToStr(Mode_Close) + Symbol() + "! Stop Loss at " + ld_16);

Not sure how to reference the last price other than Mode_Close, help, Thanks

lizmerrill

Try like this

if (soundAlerts) Alert("Long trade at " + DoubleToStr(Close[0],_Digits) + Symbol() + "! Stop Loss at " + ld_16);

liz merrill
78
liz merrill  

THANKS MLADEN

liz merrill
78
liz merrill  

MLaden,

can you convert the code below to an eld for tradestation, PLEASE.

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Red

#property indicator_color2 Green

extern bool soundAlerts = TRUE;

extern bool emailAlerts = FALSE;

double g_ibuf_84[];

double g_ibuf_88[];

double g_ibuf_92[];

int init() {

if (ObjectType("lbl") != 23) ObjectDelete("lbl");

if (ObjectFind("lbl") == -1) ObjectCreate("lbl", OBJ_LABEL, 0, Time[5], Close[5]);

ObjectSetText("lbl", "UFXT");

ObjectSet("lbl", OBJPROP_FONTSIZE, 12);

ObjectSet("lbl", OBJPROP_XDISTANCE, 5);

ObjectSet("lbl", OBJPROP_YDISTANCE, 20);

IndicatorBuffers(3);

SetIndexStyle(0, DRAW_LINE);

SetIndexBuffer(0, g_ibuf_88);

SetIndexStyle(1, DRAW_LINE);

SetIndexBuffer(1, g_ibuf_92);

SetIndexBuffer(2, g_ibuf_84);

return (0);

}

int deinit() {

ObjectDelete("lbl");

return (0);

}

int start() {

double ld_16;

if (ObjectType("lbl") != 23) ObjectDelete("lbl");

if (ObjectFind("lbl") == -1) ObjectCreate("lbl", OBJ_LABEL, 0, Time[5], Close[5]);

ObjectSetText("lbl", "UFXT");

ObjectSet("lbl", OBJPROP_FONTSIZE, 12);

ObjectSet("lbl", OBJPROP_XDISTANCE, 5);

ObjectSet("lbl", OBJPROP_YDISTANCE, 20);

double ld_0 = 1;

double l_iatr_8 = iATR(Symbol(), 0, 50, 1);

int l_bars_24 = Bars;

int l_count_28 = 0;

int li_32 = ld_0;

double ld_36 = 0;

double ld_44 = 0;

double ld_52 = 0;

double ld_60 = 0;

double ld_68 = 0;

double ld_76 = 0;

double ld_84 = 0;

double ld_92 = 0;

for (int li_100 = l_bars_24 - 1; li_100 >= 0; li_100--) {

ld_36 = 0;

ld_44 = 0;

ld_52 = 0;

ld_60 = 0;

ld_68 = 0;

for (l_count_28 = 0; l_count_28 <= li_32 - 1; l_count_28++) {

ld_36 += l_count_28;

ld_44 += Close[li_100 + l_count_28];

ld_52 += l_count_28 * (Close[li_100 + l_count_28]);

ld_60 += l_count_28 * l_count_28;

ld_68 += (Close[li_100 + l_count_28]) * (Close[li_100 + l_count_28]);

}

if (li_32 * ld_60 - ld_36 * ld_36 == 0.0) ld_76 = (li_32 * ld_52 - ld_36 * ld_44) / 0.00000001;

else ld_76 = (li_32 * ld_52 - ld_36 * ld_44) / (li_32 * ld_60 - ld_36 * ld_36);

ld_84 = (ld_44 + ld_76 * ld_36) / li_32;

if (MathSqrt((li_32 * ld_60 - ld_36 * ld_36) * (li_32 * ld_68 - ld_44 * ld_44)) == 0.0) ld_92 = (li_32 * ld_52 - ld_36 * ld_44) / 0.00000001;

else ld_92 = (li_32 * ld_52 - ld_36 * ld_44) / MathSqrt((li_32 * ld_60 - ld_36 * ld_36) * (li_32 * ld_68 - ld_44 * ld_44));

g_ibuf_84[li_100] = ld_84 - ld_76 * li_32;

}

double ld_104 = 0;

for (li_100 = l_bars_24 - 1; li_100 >= 0; li_100--) {

if (g_ibuf_84[li_100] > g_ibuf_84[li_100 + 1]) {

ld_104 += 0.1;

g_ibuf_92[li_100] = ld_104;

if (g_ibuf_88[li_100 + 1] != EMPTY_VALUE) g_ibuf_92[li_100 + 1] = g_ibuf_88[li_100 + 1];

} else {

ld_104 -= 0.1;

g_ibuf_88[li_100] = ld_104;

if (g_ibuf_92[li_100 + 1] != EMPTY_VALUE) g_ibuf_88[li_100 + 1] = g_ibuf_92[li_100 + 1];

}

}

if (g_ibuf_84[1] > g_ibuf_84[2] && g_ibuf_84[2] <= g_ibuf_84[3] && High[0] == Low[0] && High[0] == Close[0] && High[0] == Low[0]) {

ld_16 = Low - l_iatr_8 / 2.0;

if (soundAlerts) Alert("Long trade at " + Symbol() + "! Stop Loss at " + ld_16);

if (emailAlerts) SendMail("Long trade at " + Symbol() + "!", "Long trade at " + Symbol() + "! Stop Loss at " + ld_16);

}

if (g_ibuf_84[1] = g_ibuf_84[3] && High[0] == Low[0] && High[0] == Close[0] && High[0] == Low[0]) {

ld_16 = High + l_iatr_8 / 2.0;

if (soundAlerts) Alert("Short trade at " + Symbol() + "! Stop Loss at " + ld_16);

if (emailAlerts) SendMail("Short trade at " + Symbol() + "!", "Short trade in at " + Symbol() + "! Stop Loss at " + ld_16);

}

return (0);

}

Mladen Rakic
154349
Mladen Rakic  
lizmerrill:
MLaden,

can you convert the code below to an eld for tradestation, PLEASE.

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 Red

#property indicator_color2 Green

extern bool soundAlerts = TRUE;

extern bool emailAlerts = FALSE;

double g_ibuf_84[];

double g_ibuf_88[];

double g_ibuf_92[];

int init() {

if (ObjectType("lbl") != 23) ObjectDelete("lbl");

if (ObjectFind("lbl") == -1) ObjectCreate("lbl", OBJ_LABEL, 0, Time[5], Close[5]);

ObjectSetText("lbl", "UFXT");

ObjectSet("lbl", OBJPROP_FONTSIZE, 12);

ObjectSet("lbl", OBJPROP_XDISTANCE, 5);

ObjectSet("lbl", OBJPROP_YDISTANCE, 20);

IndicatorBuffers(3);

SetIndexStyle(0, DRAW_LINE);

SetIndexBuffer(0, g_ibuf_88);

SetIndexStyle(1, DRAW_LINE);

SetIndexBuffer(1, g_ibuf_92);

SetIndexBuffer(2, g_ibuf_84);

return (0);

}

int deinit() {

ObjectDelete("lbl");

return (0);

}

int start() {

double ld_16;

if (ObjectType("lbl") != 23) ObjectDelete("lbl");

if (ObjectFind("lbl") == -1) ObjectCreate("lbl", OBJ_LABEL, 0, Time[5], Close[5]);

ObjectSetText("lbl", "UFXT");

ObjectSet("lbl", OBJPROP_FONTSIZE, 12);

ObjectSet("lbl", OBJPROP_XDISTANCE, 5);

ObjectSet("lbl", OBJPROP_YDISTANCE, 20);

double ld_0 = 1;

double l_iatr_8 = iATR(Symbol(), 0, 50, 1);

int l_bars_24 = Bars;

int l_count_28 = 0;

int li_32 = ld_0;

double ld_36 = 0;

double ld_44 = 0;

double ld_52 = 0;

double ld_60 = 0;

double ld_68 = 0;

double ld_76 = 0;

double ld_84 = 0;

double ld_92 = 0;

for (int li_100 = l_bars_24 - 1; li_100 >= 0; li_100--) {

ld_36 = 0;

ld_44 = 0;

ld_52 = 0;

ld_60 = 0;

ld_68 = 0;

for (l_count_28 = 0; l_count_28 <= li_32 - 1; l_count_28++) {

ld_36 += l_count_28;

ld_44 += Close[li_100 + l_count_28];

ld_52 += l_count_28 * (Close[li_100 + l_count_28]);

ld_60 += l_count_28 * l_count_28;

ld_68 += (Close[li_100 + l_count_28]) * (Close[li_100 + l_count_28]);

}

if (li_32 * ld_60 - ld_36 * ld_36 == 0.0) ld_76 = (li_32 * ld_52 - ld_36 * ld_44) / 0.00000001;

else ld_76 = (li_32 * ld_52 - ld_36 * ld_44) / (li_32 * ld_60 - ld_36 * ld_36);

ld_84 = (ld_44 + ld_76 * ld_36) / li_32;

if (MathSqrt((li_32 * ld_60 - ld_36 * ld_36) * (li_32 * ld_68 - ld_44 * ld_44)) == 0.0) ld_92 = (li_32 * ld_52 - ld_36 * ld_44) / 0.00000001;

else ld_92 = (li_32 * ld_52 - ld_36 * ld_44) / MathSqrt((li_32 * ld_60 - ld_36 * ld_36) * (li_32 * ld_68 - ld_44 * ld_44));

g_ibuf_84[li_100] = ld_84 - ld_76 * li_32;

}

double ld_104 = 0;

for (li_100 = l_bars_24 - 1; li_100 >= 0; li_100--) {

if (g_ibuf_84[li_100] > g_ibuf_84[li_100 + 1]) {

ld_104 += 0.1;

g_ibuf_92[li_100] = ld_104;

if (g_ibuf_88[li_100 + 1] != EMPTY_VALUE) g_ibuf_92[li_100 + 1] = g_ibuf_88[li_100 + 1];

} else {

ld_104 -= 0.1;

g_ibuf_88[li_100] = ld_104;

if (g_ibuf_92[li_100 + 1] != EMPTY_VALUE) g_ibuf_88[li_100 + 1] = g_ibuf_92[li_100 + 1];

}

}

if (g_ibuf_84[1] > g_ibuf_84[2] && g_ibuf_84[2] <= g_ibuf_84[3] && High[0] == Low[0] && High[0] == Close[0] && High[0] == Low[0]) {

ld_16 = Low - l_iatr_8 / 2.0;

if (soundAlerts) Alert("Long trade at " + Symbol() + "! Stop Loss at " + ld_16);

if (emailAlerts) SendMail("Long trade at " + Symbol() + "!", "Long trade at " + Symbol() + "! Stop Loss at " + ld_16);

}

if (g_ibuf_84[1] = g_ibuf_84[3] && High[0] == Low[0] && High[0] == Close[0] && High[0] == Low[0]) {

ld_16 = High + l_iatr_8 / 2.0;

if (soundAlerts) Alert("Short trade at " + Symbol() + "! Stop Loss at " + ld_16);

if (emailAlerts) SendMail("Short trade at " + Symbol() + "!", "Short trade in at " + Symbol() + "! Stop Loss at " + ld_16);

}

return (0);

}

lizmerrill

Please, if you have it, post the original source code (that is a decompiled code) and then probably someone could help you

TraderWill
24
TraderWill  

Would please add arrows and alerts to this indicator when it crosses the 50 line. Thank you

Timing.mq4

Files:
timing.mq4 4 kb