HEIKEN ASHI

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

HEIKEN ASHI

Postby thenew » Sun Jul 31, 2011 5:37 pm

Hi everyone,
Is it possible to translate this indicator heiken ashi.mt4 into to LUA.
I use it in a mt4 demo and find it very useful...

Thanks in advance

Cheers
Luis
Attachments
heiken ashi.gif
thenew
 
Posts: 5
Joined: Sun Jul 31, 2011 5:19 pm

Re: HEIKEN ASHI

Postby sunshine » Mon Aug 01, 2011 12:59 am

Could you post the mql4 code of the indicator here?
sunshine
 

Re: HEIKEN ASHI

Postby thenew » Mon Aug 01, 2011 5:29 pm

Hope that this is what you asking for...thanks once again ;)

Code: Select all
//+------------------------------------------------------------------+
//|                                               Heiken Ashi_SW.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//|               Modififed by Igorad for display in separate window |
//|                                       "http://www.forex-tsd.com/"|
//+------------------------------------------------------------------+
//| For Heiken Ashi we recommend next chart settings ( press F8 or   |
//| select on menu 'Charts'->'Properties...'):                       |
//|  - On 'Color' Tab select 'Black' for 'Line Graph'                |
//|  - On 'Common' Tab disable 'Chart on Foreground' checkbox and    |
//|    select 'Line Chart' radiobutton                               |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Black
#property indicator_width1 3
#property indicator_color2 White
#property indicator_width2 3
#property indicator_maximum 1.05
#property indicator_minimum -0.05
//#property indicator_color3 Red/
//#property indicator_color4 White
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|
int init()
  {
//---- indicators
   IndicatorBuffers(4);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(1, ExtMapBuffer2);
  // SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Red);
   SetIndexBuffer(2, ExtMapBuffer3);
  // SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, White);
   SetIndexBuffer(3, ExtMapBuffer4);
//----
   SetIndexDrawBegin(0,10);
   SetIndexDrawBegin(1,10);
   //SetIndexDrawBegin(2,10);
   //SetIndexDrawBegin(3,10);
//---- indicator buffers mapping
   //SetIndexBuffer(0,ExtMapBuffer1);
   //SetIndexBuffer(1,ExtMapBuffer2);
   //SetIndexBuffer(2,ExtMapBuffer3);
   //SetIndexBuffer(3,ExtMapBuffer4);
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double haOpen, haHigh, haLow, haClose;
   if(Bars<=10) return(0);
   ExtCountedBars=IndicatorCounted();
//---- check for possible errors
   if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
   if (ExtCountedBars>0) ExtCountedBars--;
   int pos=Bars-ExtCountedBars-1;
   while(pos>=0)
     {
      haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2;
      haClose=(Open[pos]+High[pos]+Low[pos]+Close[pos])/4;
      haHigh=MathMax(High[pos], MathMax(haOpen, haClose));
      haLow=MathMin(Low[pos], MathMin(haOpen, haClose));
      if (haOpen<haClose)
        {
         ExtMapBuffer1[pos]=0;
         ExtMapBuffer2[pos]=1;
        }
      else
        {
         ExtMapBuffer1[pos]=1;
         ExtMapBuffer2[pos]=0;
        }
      ExtMapBuffer3[pos]=haOpen;
      ExtMapBuffer4[pos]=haClose;
       pos--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+
thenew
 
Posts: 5
Joined: Sun Jul 31, 2011 5:19 pm

Re: HEIKEN ASHI

Postby thenew » Mon Sep 19, 2011 4:02 pm

Hey, just wondering the status of this indicator, don´t want to put pressure on it just to be informed...thanks ;) ;)
thenew
 
Posts: 5
Joined: Sun Jul 31, 2011 5:19 pm

Re: HEIKEN ASHI

Postby Apprentice » Tue Sep 20, 2011 2:31 pm

Just now, I put your request in developmental order.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36478
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: HEIKEN ASHI

Postby thenew » Wed Sep 21, 2011 4:23 pm

Thanks, looking forward for this... ;)
thenew
 
Posts: 5
Joined: Sun Jul 31, 2011 5:19 pm

Re: HEIKEN ASHI

Postby Alexander.Gettinger » Thu Sep 22, 2011 11:03 am

Please, see this indicator: viewtopic.php?f=17&t=6720
Alexander.Gettinger
FXCodeBase: Confirmed User
 
Posts: 3785
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

Re: HEIKEN ASHI

Postby thenew » Thu Sep 22, 2011 5:39 pm

Much apreciated, you guys rock :)

I think there is a small issue with the indicator nothing big as i am using it already...

In the option color for the bars up /down, when it says up color BAR is the oppositte,the market is going down so red bars should been viewed not green and vice versa for color down BAR...

Hope i don´t confuse you guys...


Cheers
Luis
thenew
 
Posts: 5
Joined: Sun Jul 31, 2011 5:19 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Google [Bot] and 41 guests