Indicators with alerts/signal - page 1267

 

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:
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);

 

THANKS MLADEN

 

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:
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

 

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

Timing.mq4

Files:
timing.mq4  4 kb
 
TraderWill:
Would please add arrows and alerts to this indicator when it crosses the 50 line. Thank you Timing.mq4

TraderWill, from what i can tell the indicator looks like a decompiled rsx indicator, there are a lot of rsx's here in the forum with various types of alerts.

 

Hello again, MrTools and Mladen,

could you add an alert on the afl winner on change of color (with alerts on current).

Thank you

Files:
 
Angy:
Hello again, MrTools and Mladen,

could you add an alert on the afl winner on change of color (with alerts on current).

Thank you

Angy

Use this one : afl_winner_averages_amp_alerts.mq4

____________________

Set the average to 5 and average type to lwma and then they are going to be the same. Other than that, in this version toy have 20 types of possible averages and it solves some problems that the original has (see the comparison - upper id the original, lower is this one)

 
mladen:

Angy

Use this one : afl_winner_averages_amp_alerts.mq4

____________________

Set the average to 5 and average type to lwma and then they are going to be the same. Other than that, in this version toy have 20 types of possible averages and it solves some problems that the original has (see the comparison - upper id the original, lower is this one)

Super!

Thanx