Thread: Is it possible?
View Single Post
  #2 (permalink)  
Old 11-30-2005, 10:14 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Yes!

Quote:
Originally Posted by steve_zhng
Hi, everybody.

Is it possible to make up a indicator that can post on 30M Chart the MA curves based on 60M data?? (i.e. to post MA curve of higher time frame to lower time frame chart)
steve_zhng,

Sure, you can.

PHP Code:
int start()
  {
   
int    counted_bars=IndicatorCounted;
   
   
//---- check for possible errors
   
if (counted_bars<0) return(-1);
   
   
//---- last counted bar will be recounted
   
if (counted_bars>0counted_bars--;
   
   
int    pos=Bars-counted_bars;
   
   
//---- main calculation loop
   
while(pos>=0)
     {
       
ExtMapBuffer1[pos]= iMA(NULL,60,13,0,MODE_EMA,PRICE_CLOSE,pos);
         
pos--;
     }
   return(
0);
  } 
The second parameter in iMA function is the time frame you want to use. (here 60M).
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote