Jump to content

Recommended Posts

Posted (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 by shabz
Posted (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 by iwjw
Posted (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 by shabz
Posted
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

Posted
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

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

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 ?

Posted
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?

Posted
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

Posted

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

Posted
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

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

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...