Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 11-12-2009, 04:25 PM   #1

Join Date: Nov 2009
Location: Chicago
Posts: 1
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Can Anybody Translate This MetTrade4 Code to EasyLanguage?

#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=IndicatorCou nted();
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[i] = C_Sup11(i);
res[i] = C_Res11(i);
}

for(i=limit;i>=0;i--)
{
up[i] = iMAOnArray(res,0,3,0,MODE _SMA,i);
md[i] = C_PL_Dot(i);
dn[i] = 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[i] + Low[i]+Close[i]) / 3)
) / 3;
return (NormalizeDouble(Result,4 ));
}

double C_dot11(int i) /* 1-1 Dot */
{
double Result = (High[i] + Low[i] + Close[i])/3;
return (NormalizeDouble(Result,4 ));
}

double C_Res11(int i) /* 1-1 High */
{
double Result = (C_dot11(i) * 2) - Low[i];
return (NormalizeDouble(Result,4 ));
}

double C_Sup11(int i) /* 1-1 Low */
{
double Result = (C_dot11(i) * 2) - High[i];
return (NormalizeDouble(Result,4 ));
}
crtrading is offline  
Reply With Quote
Old 11-12-2009, 04:48 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: Can Anybody Translate This MetTrade4 Code to EasyLanguage?

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.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
What EL Code Should I Use ? emptyvault Coding Forum 4 07-01-2009 10:08 AM
Looking For LUA Code Help Dudewanarace Coding Forum 0 03-10-2009 11:57 PM
Translate a .EFS Script into TradeSense ndx100 Coding Forum 1 02-26-2009 02:35 AM
ADX Easylanguage Code Without Calling a Function Frank Coding Forum 1 02-08-2009 09:39 PM
Help To Code My EA pepe1 Coding Forum 0 06-24-2008 01:41 PM

All times are GMT -4. The time now is 02:12 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.