| Automated Trading Black box systems, strategy automation, algorithmic trading, etc... |
![]() | | Tweet | |
| | #1 | ||
![]() | Need to Rewrite Specific Macd from MQL or MultiChart for NT | ||
| |
|
| | #2 | ||
![]() | Re: Need to Rewrite Specific Macd from MQL or MultiChart for NT Quote:
| ||
|
| | #3 | ||
![]() | Re: Need to Rewrite Specific Macd from MQL or MultiChart for NT ... here is ... a mql... //+------------------------------------------------------------------+ //| Custom MACD.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" //---- indicator settings #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Green #property indicator_color2 Orange //---- indicator parameters extern int FastEMA=34; extern int SlowEMA=144; extern int SignalSMA=34; //---- indicator buffers double ind_buffer3[]; double ind_buffer4[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexStyle(0,DRAW_HIST OGRAM,STYLE_SOLID,1); SetIndexStyle(1,DRAW_HIST OGRAM,STYLE_SOLID,1); // SetIndexDrawBegin(1,Signa lSMA); IndicatorDigits(MarketInf o(Symbol(),MODE_DIGITS)+1 ); //---- indicator buffers mapping if(!SetIndexBuffer(0,ind_ buffer3) && !SetIndexBuffer(1,ind_buf fer4)) Print("cannot set indicator buffers!"); //---- name for DataWindow and indicator subwindow label IndicatorShortName("MACDF orest("+FastEMA+","+SlowE MA+","+SignalSMA+")"); SetIndexLabel(0,"MACDfore st"); SetIndexLabel(1,"MACDfore st"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| Moving Averages Convergence/Divergence | //+------------------------------------------------------------------+ int start() { int limit,i; double MACDForestPre; int counted_bars=IndicatorCou nted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(i=limit; i>=0; i--) { double MACDForest=iMACD(NULL,0,F astEMA,SlowEMA,SignalSMA, PRICE_MEDIAN,MODE_MAIN,i)-iMACD(NULL,0,FastEMA,Slow EMA,SignalSMA,PRICE_MEDIA N,MODE_SIGNAL,i); if (MACDForest>=MACDForestPr e) {ind_buffer3[i]=MACDForest; ind_buffer4[i]=EMPTY_VALUE;} if (MACDForest<MACDForestPre ) {ind_buffer4[i]=MACDForest; ind_buffer3[i]=EMPTY_VALUE;} MACDForestPre=MACDForest; } //---- done return(0); } ... thanks for response.. | ||
| |
|
![]() |
| Thread Tools | |
| Display Modes | Help Others By Rating This Thread |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help in Convert This MACD to Multichart | theman | Coding Forum | 3 | 06-01-2008 09:03 AM |
| Hull MACD | Minetoo | Coding Forum | 12 | 11-07-2007 04:10 PM |
| MACD with Hull Moving Averages | Soultrader | Trading Indicators | 2 | 09-06-2007 05:52 PM |
| Be Specific: Precisely What Are You Doing Wrong? | MrPaul | Market Analysis | 4 | 11-14-2006 06:58 PM |