Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

crtrading

Can Anybody Translate This MetTrade4 Code to EasyLanguage?

Recommended Posts

#property indicator_buffers 3

#property indicator_chart_window

#property indicator_color1 Red

#property indicator_color2 Red

#property indicator_color3 Red

 

 

 

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

 

//draw buffers

double up[];

double md[];

double dn[];

 

//count buffers

double res[];

double sup[];

 

int init()

 

{

//---- indicators

IndicatorBuffers(5);

 

SetIndexBuffer(0,up);

SetIndexBuffer(1,md);

SetIndexBuffer(2,dn);

SetIndexBuffer(3,res);

SetIndexBuffer(4,sup);

 

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);

SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,2);

SetIndexShift(0,1);

SetIndexShift(1,1);

SetIndexShift(2,1);

 

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

 

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

//----

int limit;

int counted_bars=IndicatorCounted();

if(counted_bars<0) counted_bars=0;

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

for(int i=limit;i>=0;i--)

{

sup = C_Sup11(i);

res = C_Res11(i);

}

 

for(i=limit;i>=0;i--)

{

up = iMAOnArray(res,0,3,0,MODE_SMA,i);

md = C_PL_Dot(i);

dn = iMAOnArray(sup,0,3,0,MODE_SMA,i);

}

//----

return(0);

}

//+------------------------------------------------------------------+

double C_PL_Dot(int i)

{

double Result = (

((High[i+1] + Low[i+1]+Close[i+1]) / 3) +

((High[i+2] + Low[i+2]+Close[i+2]) / 3) +

((High + Low+Close) / 3)

) / 3;

return (NormalizeDouble(Result,4));

}

 

double C_dot11(int i) /* 1-1 Dot */

{

double Result = (High + Low + Close)/3;

return (NormalizeDouble(Result,4));

}

 

double C_Res11(int i) /* 1-1 High */

{

double Result = (C_dot11(i) * 2) - Low;

return (NormalizeDouble(Result,4));

}

 

double C_Sup11(int i) /* 1-1 Low */

{

double Result = (C_dot11(i) * 2) - High;

return (NormalizeDouble(Result,4));

}

Share this post


Link to post
Share on other sites

with little background, chart, or description,

I double you are motivating anybody to help.

 

the least you can do is to cite the source and give credit to the author.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.