TRO, Heiken-Ashi Smoothed request?.. would be very useful

If you don't know where to start, start here! Don't be afraid to ask questions.

Moderator: moderators

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 0
Gender: Male
Contact:

Postby flinux » Mon Apr 05, 2010 6:38 pm

Use this string:

string q[] = {"EURUSD","GBPUSD","USDJPY","EURJPY","GBPJPY","USDCHF","USDCAD","NZDUSD"};
So faith, hope, love remain, these three; but the greatest of these is love. - 1 Corinthians 13:13

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

PINKPANTHER5
rank: 150+ posts
rank: 150+ posts
Posts: 216
Joined: Fri Feb 13, 2009 7:52 pm
Reputation: 0
Gender: Male
Contact:

Postby PINKPANTHER5 » Mon Apr 05, 2010 8:36 pm

flinux wrote:Use this string:

string q[] = {"EURUSD","GBPUSD","USDJPY","EURJPY","GBPJPY","USDCHF","USDCAD","NZDUSD"};



Thats what I did and its still doing it. Its the first line of code right? I replaced it but it still keeps saying W.


:(

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 0
Gender: Male
Contact:

Postby flinux » Mon Apr 05, 2010 8:46 pm

I see you have used something like "EURUSDFX" instead of "EURUSD". Check again.
So faith, hope, love remain, these three; but the greatest of these is love. - 1 Corinthians 13:13

PINKPANTHER5
rank: 150+ posts
rank: 150+ posts
Posts: 216
Joined: Fri Feb 13, 2009 7:52 pm
Reputation: 0
Gender: Male
Contact:

Postby PINKPANTHER5 » Mon Apr 05, 2010 8:50 pm

Yes but before I had changed it to that. Can I paste the code here? Or is it sort of a private indicator of yours? I will show you exactly what the code is right now which doesn't seem to work...

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 0
Gender: Male
Contact:

Postby flinux » Mon Apr 05, 2010 9:27 pm

Paste here the code :D
So faith, hope, love remain, these three; but the greatest of these is love. - 1 Corinthians 13:13

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

PINKPANTHER5
rank: 150+ posts
rank: 150+ posts
Posts: 216
Joined: Fri Feb 13, 2009 7:52 pm
Reputation: 0
Gender: Male
Contact:

Postby PINKPANTHER5 » Mon Apr 05, 2010 10:26 pm

Sure thing Flinux...






//+------------------------------------------------------------------+
//| FLI_MP_HAS.mq4 |
//| Copyright ? 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_chart_window

string q[] = {"EURUSD","GBPUSD","USDJPY","EURJPY","GBPJPY","USDCHF","USDCAD","NZDUSD"};
int t[] = {PERIOD_M1,PERIOD_M5,PERIOD_M15,PERIOD_M30,PERIOD_H1,PERIOD_H4,PERIOD_D1,PERIOD_W1,PERIOD_MN1};
string TAG="FLIMPHAS";
extern int maMethod = 2;
extern int maPeriod = 6;
extern int maMethod2 = 3;
extern int maPeriod2 = 2;
int nq, nt;

extern int xShift=300;
extern int yShift=250;

int getHAS(string s, int tf)
{
double a, b;
a = iCustom(s,tf,"Heiken_Ashi_Smoothed",maMethod,maPeriod,maMethod2,maPeriod2,6,0);
b = iCustom(s,tf,"Heiken_Ashi_Smoothed",maMethod,maPeriod,maMethod2,maPeriod2,7,0);
if (a<b) return(1);
if (a>b) return(-1);
return(0);
}

void ObDeleteObjectsByPrefix(string Prefix)
{
int L = StringLen(Prefix);
int i = 0;
while(i < ObjectsTotal())
{
string ObjName = ObjectName(i);
if(StringSubstr(ObjName, 0, L) != Prefix)
{
i++;
continue;
}
ObjectDelete(ObjName);
}
}

int init()
{
int i, j;
deinit();
nq = ArraySize(q);
nt = ArraySize(t);

ObjectCreate(TAG+"Head",OBJ_LABEL,0,0,0,0,0);
ObjectSet(TAG+"Head",OBJPROP_CORNER,1);
ObjectSet(TAG+"Head",OBJPROP_XDISTANCE,xShift+55);
ObjectSet(TAG+"Head",OBJPROP_YDISTANCE,yShift+0);
ObjectSetText(TAG+"Head","Heiken Ashi Smoothed DB",12,"Courier",DeepSkyBlue);

for (i=0;i<nq;i++)
{
ObjectCreate(TAG+"lblCurr"+i,OBJ_LABEL,0,0,0,0,0);
ObjectSet(TAG+"lblCurr"+i,OBJPROP_CORNER,1);
ObjectSet(TAG+"lblCurr"+i,OBJPROP_XDISTANCE,xShift+180);
ObjectSet(TAG+"lblCurr"+i,OBJPROP_YDISTANCE,yShift+20*(i+1));
ObjectSetText(TAG+"lblCurr"+i,q[i],12,"Courier",Silver);
for (j=0;j<nt;j++)
{
ObjectCreate(TAG+"x"+j+"c"+i,OBJ_LABEL,0,0,0,0,0);
ObjectSet(TAG+"x"+j+"c"+i,OBJPROP_CORNER,1);
ObjectSet(TAG+"x"+j+"c"+i,OBJPROP_XDISTANCE,xShift+150-(20*j));
ObjectSet(TAG+"x"+j+"c"+i,OBJPROP_YDISTANCE,yShift+20*(i+1));
}
}
return(0);
}

int deinit()
{
ObDeleteObjectsByPrefix(TAG);
return(0);
}

int start()
{
int counted_bars=IndicatorCounted();
int a;
int i, j;

for (i=0;i<nq;i++)
{
for (j=0;j<nt;j++)
{
a = getHAS(q[i],t[j]);
if (a==1)
ObjectSetText(TAG+"x"+j+"c"+i,"B",12,"Courier",Lime);
else if (a==-1)
ObjectSetText(TAG+"x"+j+"c"+i,"S",12,"Courier",Red);
else if (a==0)
ObjectSetText(TAG+"x"+j+"c"+i,"W",12,"Courier",Yellow);
}
}

return(0);
}
//+------------------------------------------------------------------+

User avatar
flinux
rank: 150+ posts
rank: 150+ posts
Posts: 219
Joined: Wed May 27, 2009 9:52 pm
Reputation: 0
Gender: Male
Contact:

Postby flinux » Tue Apr 06, 2010 10:22 am

Is Heiken_Ashi_Smoothed.mq4 indicator in your indicators folder ?
This code seems fine to me.
So faith, hope, love remain, these three; but the greatest of these is love. - 1 Corinthians 13:13

PINKPANTHER5
rank: 150+ posts
rank: 150+ posts
Posts: 216
Joined: Fri Feb 13, 2009 7:52 pm
Reputation: 0
Gender: Male
Contact:

Postby PINKPANTHER5 » Tue Apr 06, 2010 2:07 pm

Yes Flinux

I double checked everything. I can't seem to figure it out. I tried on another pc and still the same thing happens. :(

Could it be mt4 changed something?

moneymarkets
rank: <50 posts
rank: <50 posts
Posts: 13
Joined: Mon May 22, 2006 12:52 am
Reputation: 0
Gender: Male

Postby moneymarkets » Tue Apr 06, 2010 9:16 pm

I tried the indicator and it did the same thing on my mt4. It is puzzling.
thanks for all your help.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “beginners forum”