shabz Posted August 10, 2010 Report Posted August 10, 2010 Can anyone make this indicator into MTF version ? http://www.4shared.com/file/-1hz-pr6/Trend_Detector2.html Thanks. Quote
jeywhistle Posted August 10, 2010 Report Posted August 10, 2010 the indicator repints, therefore to make it MTF would make it repaint even more... Quote
shabz Posted August 10, 2010 Author Report Posted August 10, 2010 (edited) I appreciate what you say, but this indicator is used only as a confirmation, even if it repaints 3 bars back, it would be still useful to me. Edited August 10, 2010 by shabz Quote
iwjw Posted August 10, 2010 Report Posted August 10, 2010 (edited) Hi shabz, you got my indi Trend Magic2_MTF. You only have to change the name of the indicator where iCustom is called and replace CCI,ATR with the external parameters of Trend Detector. I've got version 1 of TD and that indi doesn't have any parameters...so you only have to delete CCI and ATR Try it...it's really simple edit: But don't forget that you have to save the file with an other name!!! (File/Save As) Edited August 10, 2010 by iwjw Quote
shabz Posted August 10, 2010 Author Report Posted August 10, 2010 (edited) Hi iwjw, I have tried to do what you described, but I must be doing something wrong, it still shows up as the standard one. Any help would be appreciated. Thanks. Edited August 10, 2010 by shabz Quote
iwjw Posted August 10, 2010 Report Posted August 10, 2010 Hi iwjw, I have tried to do what you described, but I must be doing something wrong, it still shows up as the standard one. Any help would be appreciated. Thanks. Sorry, my fault didn't notice that the indi is running in a separate window and uses histogram instead of line here you go http://[email protected]/file/ZVcDB8Hb/TD2_MTF.html Quote
iwjw Posted August 10, 2010 Report Posted August 10, 2010 4 TF version http://[email protected]/file/oAm6DojI/4_TF_TD.html Quote
shabz Posted August 10, 2010 Author Report Posted August 10, 2010 Sorry, my fault didn't notice that the indi is running in a separate window and uses histogram instead of line here you go http://[email protected]/file/ZVcDB8Hb/TD2_MTF.html I see you have sent the ex4 file not the mq4, I wanted to see what you did differently to what I was doing. The 4 TF version is a nice touch. Thanks for both indi's Quote
iwjw Posted August 10, 2010 Report Posted August 10, 2010 I see you have sent the ex4 file not the mq4, I wanted to see what you did differently to what I was doing. The 4 TF version is a nice touch. Thanks for both indi's Here are the .mq4 http://[email protected]/file/-cE44Z44/TD_online.html shabz 1 Quote
shabz Posted August 11, 2010 Author Report Posted August 11, 2010 Thanks again iwjw, You are a genius. I take it that for the MTF to work you must have the original indicator loaded ? I am trying to understand the code, this has been most helpful. Quote
shabz Posted August 11, 2010 Author Report Posted August 11, 2010 Hi iwjw, Is there any line of code that can be added to the indicators to make them refresh say on the close of each 1 or 5 min candle ? Quote
iwjw Posted August 11, 2010 Report Posted August 11, 2010 Hi iwjw, Is there any line of code that can be added to the indicators to make them refresh say on the close of each 1 or 5 min candle ? you don't want the indi to refresh every tick instead after close of candle? Quote
shabz Posted August 11, 2010 Author Report Posted August 11, 2010 After the close of each candle would be enough I think, what do you say ? Quote
iwjw Posted August 11, 2010 Report Posted August 11, 2010 After the close of each candle would be enough I think, what do you say ? One way to get the open of a new candle is to add a function: bool IsNewBar(int theBar, int myPeriod) { static datetime barTime=0; if(barTime<iTime(Symbol(),myPeriod,theBar)) { barTime=iTime(Symbol(),myPeriod,theBar); return(true); } return(false); } then you have to change this part: MTFshift=iBarShift(NULL,HigherTF,Time[shift]); bufferUp[shift]=iCustom(NULL,HigherTF,"Trend Detector2",0,MTFshift); bufferDn[shift]=iCustom(NULL,HigherTF,"Trend Detector2",1,MTFshift); into this and call NewBar Function: if(NewBar(shift,PERIOD_M5) { MTFshift=iBarShift(NULL,HigherTF,Time[shift]); bufferUp[shift]=iCustom(NULL,HigherTF,"Trend Detector2",0,MTFshift); bufferDn[shift]=iCustom(NULL,HigherTF,"Trend Detector2",1,MTFshift); } you can replace PERIOD_M5 with any period you want...you could make a new parameter like the existing HigherTF and use that Simply replace PERIOD_M5 with the name of the parameter Quote
shabz Posted August 11, 2010 Author Report Posted August 11, 2010 Where does the first part of the code go ? and the second part only the line if(NewBar(shift,PERIOD_M5) is added ? and does this mean the indicator refreshes every 5 minutes ? and can be changed to refresh at any other interval by changing PERIOD_M5 ? I am a real newbie with MQL4 Quote
iwjw Posted August 11, 2010 Report Posted August 11, 2010 Where does the first part of the code go ? and the second part only the line if(NewBar(shift,PERIOD_M5) is added ? and does this mean the indicator refreshes every 5 minutes ? and can be changed to refresh at any other interval by changing PERIOD_M5 ? I am a real newbie with MQL4 I know that it doesn't help you to improve your MQL skills if I code it, but it's easier for me: http://[email protected]/file/wD9ZMcxK/TD2_MTFR.html There's a new parameter: RefreshPeriod...if you set it to 5, the indi will refresh on open of a M5 candle Quote
shabz Posted August 12, 2010 Author Report Posted August 12, 2010 Hi iwjw, Thanks again,will test it, excellent. Any ideas how to sort out the MTF Macd Osma indicator ? I will start a new thread to show you a screenshot of what is happening. Quote
shabz Posted August 16, 2010 Author Report Posted August 16, 2010 Hi iwjw, When I open MT4 platform after a while that it has been shut down, the trend detector MTF bars are missing from the point where it was closed to the current time point. If I open the indicator inputs & press ok, it will refresh & the missing data reappears. Is this because it is set to refresh per close of bar than per tick ? Can we modify it so, the data loads up automatically on restart of MT4 ? Thanks again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.