Hello & Welcome on board !!! :-)
Please note:
Before you can post a message on the forum you need to REGISTER to get a unique GiG username (Totally Free!). Feel free to look around - just start browsing any of the sections from the home page of GiG. Join the community!.
Here you can discuss/request mql4 code, how to code in MQL…
  • User avatar
  • User avatar
User avatar
By firewight
#1717
firewight wrote: 11 Sep 2017, 04:48
Geko wrote: 06 Sep 2017, 15:17My bad ;-)
Hey mate!

There does seem to be a small issue with the slideshow hanging on the final symbol of the array, even when the stop slideshow at the end is set to false, which means it should loop back to the start...

Its not a big deal though, just thought I'd mention it!

Cheers!
Actually, I have a theory about this.

Are the second intervals for the slideshow actually seconds, or are they "ticks"?

Because it seems to hang up on the last symbol, which is an indices (DAX) and is not open at certain times of the day, which means it may not get ticks coming in to progress the slideshow.

Because at other times of the day it seems to work fine...

Just a thought.

Cheers!
User avatar
By SickOfScam
#1718
Hi guys and of course ladies. I have a small problem because I can not include SSL as iCustom in GVC's DASH that I modified according to my needs .
I tried to solve this by replacing SSL with HAS which fit well but... :
1. HAS does not have the same logic as SSL (not channel) and
2. Now my DASH is incredibly slow and for execution is sometimes needed more than 20 seconds which is of course not acceptable.
I think it's best to type the complete SSL logic in DASH using iMA from MT4. This would make EA faster than using SSL on iCustom.
And now comes the part related to the "small problem" - I really tried, but ... huuh!!!
This is part of the code with an in-built HAS:

void GetCandleDirection() {
for (int i=0;i<ArraySize(TradePairs);i++) {

double Openm15 = iCustom(TradePairs, PERIOD_M15, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
double Closem15 = iCustom(TradePairs, PERIOD_M15, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,1);
double Openh1 = iCustom(TradePairs, PERIOD_H1, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
double Closeh1 = iCustom(TradePairs, PERIOD_H1, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,1);
double Openh4 = iCustom(TradePairs, PERIOD_H4, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
double Closeh4 = iCustom(TradePairs, PERIOD_H4, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,1);
double Opend1 = iCustom(TradePairs, PERIOD_D1, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,0);
double Closed1 = iCustom(TradePairs, PERIOD_D1, "Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,1);

if(Closem15>Openm15)signals.Signalm15=UP;
if(Closem15<Openm15)signals.Signalm15=DOWN;
if(Closeh1>Openh1)signals[i].Signalh1=UP;
if(Closeh1<Openh1)signals[i].Signalh1=DOWN;
if(Closeh4>Openh4)signals[i].Signalh4=UP;
if(Closeh4<Openh4)signals[i].Signalh4=DOWN;
if(Closed1>Opend1)signals[i].Signald1=UP;
if(Closed1<Opend1)signals[i].Signald1=DOWN;
if(Closew1>Openw1)signals[i].Signalw1=UP;
if(Closew1<Openw1)signals[i].Signalw1=DOWN;

signals[i].SignaldirupM15=signals[i].Signalm15== UP;
signals[i].SignaldirdnM15=signals[i].Signalm15==DOWN;
signals[i].SignaldirupH1= signals[i].Signalh1== UP;
signals[i].SignaldirdnH1= signals[i].Signalh1== DOWN;
signals[i].SignaldirupH4= signals[i].Signalh4== UP;
signals[i].SignaldirdnH4= signals[i].Signalh4== DOWN;
signals[i].SignaldirupD1= signals[i].Signald1== UP;
signals[i].SignaldirdnD1= signals[i].Signald1== DOWN;
}
}
void SetColors(int i) {

if(signals[i].Signalm15==1){Color1 =BullColor0;}
if(signals[i].Signalm15==-1){Color1=BearColor0;}
if(signals[i].Signalh1==1){Color2=BullColor0;}
if(signals[i].Signalh1==-1){Color2=BearColor0;}
if(signals[i].Signalh4==1){Color3=BullColor0;}
if(signals[i].Signalh4==-1){Color3=BearColor0;}
if(signals[i].Signald1==1){Color4=BullColor0;}
if(signals[i].Signald1==-1){Color4=BearColor0;}
}
void Get_.................
User avatar
By SickOfScam
#1719
I tried "something like ..." this:

void GetCandleDirection() {
for (int i=0;i<ArraySize(TradePairs);i++) {

double fastMa15= iMA(TradePairs,PERIOD_M15,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMa15= iMA(TradePairs,PERIOD_M15,MA1Period,0,MA1Method,PRICE_LOW,0);

if(Close(TradePairs,PERIOD_M15,0)>fastMa15)signals.Signalm15=UP;
if(Close(TradePairs,PERIOD_M15,1)>fastMa15 && Close(TradePairs,PERIOD_M15,0)<fastMa15 && Close(TradePairs,PERIOD_M15,0)>slowMa15)signals.Signalm15=UP;
else
if(Close(TradePairs,PERIOD_M15,0) < slowMa15)signals.Signalm15=DOWN;
if(Close(TradePairs[i],PERIOD_M15,1) < slowMa15 && Close(TradePairs[i],PERIOD_M15,0)>slowMa15 && Close(TradePairs[i],PERIOD_M15,0) < fastMa15) signals[i].Signalm15=DOWN;

double fastMa60= iMA(TradePairs[i],PERIOD_H1,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMa60= iMA(TradePairs[i],PERIOD_H1,MA1Period,0,MA1Method,PRICE_LOW,0);

if(Close(TradePairs[i],PERIOD_H1,0)>fastMa60)signals[i].Signalh1=UP;
if(iClose(TradePairs[i],PERIOD_H1,1)>fastMa60 && Close(TradePairs[i],PERIOD_H1,0)<fastMa60 && Close(TradePairs[i],PERIOD_H1,0) > slowMa60)signals[i].Signalh1=UP;
else
if(Close(TradePairs[i],PERIOD_H1,0)<slowMa60)signals[i].Signalh1=DOWN;
if(Close(TradePairs[i],PERIOD_H1,1)<slowMa60 && Close(TradePairs[i],PERIOD_H1,0)>slowMa60 && Close(TradePairs[i],PERIOD_H1,0) < fastMa60)signals[i].Signalh1=DOWN;

double fastMa240= iMA(TradePairs[i],PERIOD_H4,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMa240= iMA(TradePairs[i],PERIOD_H4,MA1Period,0,MA1Method,PRICE_LOW,0);

if(Close(TradePairs[i],PERIOD_H4,0)>fastMa240)signals[i].Signalh4=UP;
if(Close(TradePairs[i],PERIOD_H4,1)>fastMa240 && Close(TradePairs[i],PERIOD_H4,0)<fastMa240 && Close(TradePairs[i],PERIOD_H4,0) > slowMa240)signals[i].Signalh4=UP;
else
if(Close(TradePairs[i],PERIOD_H4,0)<slowMa240)signals[i].Signalh4=DOWN;
if(Close(TradePairs[i],PERIOD_H4,1)<slowMa240 && Close(TradePairs[i],PERIOD_H4,0)>slowMa240 && Close(TradePairs[i],PERIOD_H4,0) < fastMa240)signals[i].Signalh4=DOWN;

double fastMaD1= iMA(TradePairs[i],PERIOD_D1,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMaD1= iMA(TradePairs[i],PERIOD_D1,MA1Period,0,MA1Method,PRICE_LOW,0);

if(Close(TradePairs[i],PERIOD_D1,0)>fastMaD1)signals[i].Signald1=UP;
if(Close(TradePairs[i],PERIOD_D1,1)>fastMaD1 && Close(TradePairs[i],PERIOD_D1,0)<fastMaD1 && Close(TradePairs[i],PERIOD_D1,0) > slowMaD1)signals[i].Signald1=UP;
else
if(Close(TradePairs[i],PERIOD_D1,0)<slowMaD1)signals[i].Signald1=DOWN;
else if(Close(TradePairs[i],PERIOD_D1,1)<slowMaD1 && Close(TradePairs[i],PERIOD_D1,0)>slowMaD1 && Close(TradePairs[i],PERIOD_D1,0) < fastMaD1)signals[i].Signald1=DOWN;

signals[i].SignaldirupScalp=signals[i].Signalm15== UP;
signals[i].SignaldirdnScalp=signals[i].Signalm15==DOWN;

signals[i].SignaldirupSwing=signals[i].Signalh4== UP;
signals[i].SignaldirdnSwing=signals[i].Signalh4==DOWN;
}
}
void SetColors(int i) {

if(signals[i].Signalm15==1){Color1 =BullColor0;}
if(signals[i].Signalm15==-1){Color1=BearColor0;}
if(signals[i].Signalh1==1){Color2=BullColor0;}
if(signals[i].Signalh1==-1){Color2=BearColor0;}
if(signals[i].Signalh4==1){Color3=BullColor0;}
if(signals[i].Signalh4==-1){Color3=BearColor0;}
if(signals[i].Signald1==1){Color4=BullColor0;}
if(signals[i].Signald1==-1){Color4=BearColor0;}
}

void Ge................................................
User avatar
By SickOfScam
#1722
Yeep, now I can see that:
"You cannot edit your posts in this forum
You cannot delete your posts in this forum"

Anyway this is the code I wanted to show, in case somebody has a suggestion - or would like to help.

void GetCandleDirection() {
for (int i=0;i<ArraySize(TradePairs);i++) {

double fastMa15= iMA(TradePairs,PERIOD_M15,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMa15= iMA(TradePairs,PERIOD_M15,MA1Period,0,MA1Method,PRICE_LOW,0);

if(iClose(TradePairs,PERIOD_M15,1)>fastMa15)signals.Signalm15=UP;
if(signals.Signalm15==UP && iClose(TradePairs,PERIOD_M15,0) < fastMa15 && iClose(TradePairs,PERIOD_M15,0)>slowMa15)signals.Signalm15=UP;
else
if(iClose(TradePairs,PERIOD_M15,1)<slowMa15)signals.Signalm15=DOWN;
if(signals[i].Signalm15==DOWN && iClose(TradePairs[i],PERIOD_M15,1)>slowMa15 && iClose(TradePairs[i],PERIOD_M15,1) < fastMa15) signals[i].Signalm15=DOWN;

double fastMa60= iMA(TradePairs[i],PERIOD_H1,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMa60= iMA(TradePairs[i],PERIOD_H1,MA1Period,0,MA1Method,PRICE_LOW,0);

if(iClose(TradePairs[i],PERIOD_H1,1)>fastMa60)signals[i].Signalh1=UP;
if(signals[i].Signalh1==UP && iClose(TradePairs[i],PERIOD_H1,1)<fastMa60 && iClose(TradePairs[i],PERIOD_H1,1) > slowMa60)signals[i].Signalh1=UP;
else
if(iClose(TradePairs[i],PERIOD_H1,1)<slowMa60)signals[i].Signalh1=DOWN;
if(signals[i].Signalh1==DOWN && iClose(TradePairs[i],PERIOD_H1,1)>slowMa60 && iClose(TradePairs[i],PERIOD_H1,1) < fastMa60)signals[i].Signalh1=DOWN;

double fastMa240= iMA(TradePairs[i],PERIOD_H4,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMa240= iMA(TradePairs[i],PERIOD_H4,MA1Period,0,MA1Method,PRICE_LOW,0);

if(iClose(TradePairs[i],PERIOD_H4,1)>fastMa240)signals[i].Signalh4=UP;
if(signals[i].Signalh4==UP && iClose(TradePairs[i],PERIOD_H4,1)<fastMa240 && iClose(TradePairs[i],PERIOD_H4,1) > slowMa240)signals[i].Signalh4=UP;
else
if(iClose(TradePairs[i],PERIOD_H4,1)<slowMa240)signals[i].Signalh4=DOWN;
if(signals[i].Signalh4==DOWN && iClose(TradePairs[i],PERIOD_H4,1)>slowMa240 && iClose(TradePairs[i],PERIOD_H4,1) < fastMa240)signals[i].Signalh4=DOWN;

double fastMaD1= iMA(TradePairs[i],PERIOD_D1,MA1Period,0,MA1Method,PRICE_HIGH,0);
double slowMaD1= iMA(TradePairs[i],PERIOD_D1,MA1Period,0,MA1Method,PRICE_LOW,0);

if(iClose(TradePairs[i],PERIOD_D1,1)>fastMaD1)signals[i].Signald1=UP;
if(signals[i].Signald1==UP && iClose(TradePairs[i],PERIOD_D1,1)<fastMaD1 && iClose(TradePairs[i],PERIOD_D1,1) > slowMaD1)signals[i].Signald1=UP;
else
if(iClose(TradePairs[i],PERIOD_D1,1)<slowMaD1)signals[i].Signald1=DOWN;
if(signals[i].Signald1==DOWN && iClose(TradePairs[i],PERIOD_D1,1)>slowMaD1 && iClose(TradePairs[i],PERIOD_D1,1) < fastMaD1)signals[i].Signald1=DOWN;

signals[i].SignaldirupScalp=signals[i].Signalm15== UP;
signals[i].SignaldirdnScalp=signals[i].Signalm15==DOWN;

signals[i].SignaldirupSwing=signals[i].Signalh4== UP &&signals[i].Signald1== UP;
signals[i].SignaldirdnSwing=signals[i].Signalh4==DOWN &&signals[i].Signald1==DOWN;
}
}
void SetColors(int i) {

if(signals[i].Signalm15==1){Color1=BullColor0;}
if(signals[i].Signalm15==-1){Color1=BearColor0;}
if(signals[i].Signalh1==1){Color2=BullColor0;}
if(signals[i].Signalh1==-1){Color2=BearColor0;}
if(signals[i].Signalh4==1){Color3=BullColor0;}
if(signals[i].Signalh4==-1){Color3=BearColor0;}
if(signals[i].Signald1==1){Color4=BullColor0;}
if(signals[i].Signald1==-1){Color4=BearColor0;}
}

void Ge
By mrdfx
#1725
@geko can you tell me if its possible for a notification alert to be added to an indicator I have? I have a very cool indicator that will show an arrow on the chart when there is a reversal and it would be great if there could be a pop up alert when the arrow appears? One thing to mention is that I don't have the .mq4 file only the .ex4 file. Thanks. :)
By mrdfx
#1727
firewight wrote: 13 Sep 2017, 18:58 Ouch without the code it is gonna be hard... I have heard of 3rd party indicators/experts that react to chart objects, so if an arrow appears they perform an action, but not sure how hard that is...

Is the indi any good?
Yeah it is very good for trading reversals. When there is a reversal it will paint an up or down arrow on the chart, but many times I'm not looking at the chart and see it after it has reversed so if there was an alert pop up I could catch the reversal in time.
User avatar
By firewight
#1728
mrdfx wrote: 13 Sep 2017, 20:21
firewight wrote: 13 Sep 2017, 18:58 Ouch without the code it is gonna be hard... I have heard of 3rd party indicators/experts that react to chart objects, so if an arrow appears they perform an action, but not sure how hard that is...

Is the indi any good?
Yeah it is very good for trading reversals. When there is a reversal it will paint an up or down arrow on the chart, but many times I'm not looking at the chart and see it after it has reversed so if there was an alert pop up I could catch the reversal in time.
Hey mate, would you mind if I take a look at the indicator?
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]