MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Dozens financial books in MetaTrader Market

Silver Trend indicator

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
14
william.teo 2012.04.28 19:16
 

Hi All,

I had been evaluating trend indicators lately. Came across Stalin, Notarius and recently Silver Trend.

Had done backtesting, and found that Silver Trend provides excellent results, with little losses on whipsaws but large winners on trends.

The backtests (manual) were done on fx and commodities.

I am interested to know if anyone else have used these indicators, what are your verdicts and whether I can convert these indicators into expert trading advisors.

Cheers, hope to hear from you soon.

Attached files:
  silvertrend_signal.mq5  (7.07 KB)
 
To Sleep, or Not to Sleep?

To Sleep, or Not to Sleep?

An alternative use of the Sleep() function in the realization of pauses between EA's actions is proposed. The approach under consideration allows a smart use of machine time.

avatar
1002
avatar
14
william.teo 2012.04.28 19:56 #
 

Sorry, this is the MT4 version.

Attached files:
  silverctrendowithjalert.mq4  (3.16 KB)
avatar
1002
dabbler 2012.04.28 22:12 #
 
william.teo:

Sorry, this is the MT4 version.

Thanks for that. I ran it in the strategy tester in visual mode to see what it does.

I notice that it redraws the last arrow so that it can give a signal then change its mind. This behavior makes it look good as an indicator when checking historical charts, but that view is mis-leading on a real chart :-(

  if (CountBars>=Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+SSP);
   SetIndexDrawBegin(1,Bars-CountBars+SSP);

These lines appear to belong in the init function rather than the start function (wasting processing power repeating them every tick).

 
avatar
14
william.teo 2012.04.29 10:39 #
 

Hi Dabbler, thanks for the valuable feedback.

I had a run on the strategy tester also. (thanks! I learned from you that I could run indicators on the Strategy Tester).

True to what you said, it changes its mind, and is misleading for real-time trading.

I did notice that the signal arrow is only confirmed (shown) at the close of a candle or bar.

Then logically, a position can be opened on the opening of the next candle or bar based on this signal.

I ran a back-test and gave up quickly - as I realized that the losses were too many compared to winner; buys were at lows and sells were at highs. It could be disastrous. The trend winners will not be able to cover the numerous stop losses.

I also looked at another indicator quite similar to this one, but the signals are vastly different and also, buys are at lows and sells are at highs. I superimposed the results on two moving averages and the entries were quite consistent with crossovers of these moving averages.

The problem is - when I ran this one on the Strategy Tester, there were no signals shown. It ran, but no show of arrows or dots.

Hope you or somebody can help to modify so that it can run properly on Strategy Tester.

I enclose the file, and rest assured, it is MT4 this time.

thanks!!

Attached files:
  shi_silvertrendsig1.mq4  (3.66 KB)
 
avatar
146
erzo 2012.04.29 11:14 #
 

william.teo:

The problem is - when I ran this one on the Strategy Tester, there were no signals shown. It ran, but no show of arrows or dots.

Hope you or somebody can help to modify so that it can run properly on Strategy Tester.

I enclose the file, and rest assured, it is MT4 this time.

It is not an indicator. Try with these modifications:

   if(CB<0) return(-1); else if(NB>Bars-CB) NB=Bars-CB;
   if (NB<100) NB=100;
   for (SH=0;SH<NB;SH++)
   {
      for (R=0,i=SH;i<SH+10;i++) {R+=(10+SH-i)*(High[i]-Low[i]);}      R/=55;

      SHMax = High[Highest(NULL,0,MODE_HIGH,Per,SH)];
      SHMin = Low[Lowest(NULL,0,MODE_LOW,Per,SH)];
      if (Close[SH]<SHMin+(SHMax-SHMin)*Otstup/100 && UD!=SH_SELL) { BufU[SH]=Low[SH]-R*0.5; UD=SH_SELL; } else {BufU[SH] = EMPTY_VALUE;}
      if (Close[SH]>SHMax-(SHMax-SHMin)*Otstup/100 && UD!=SH_BUY) { BufD[SH]=High[SH]+R*0.5; UD=SH_BUY; } else {BufD[SH] = EMPTY_VALUE;}
   }
avatar
1002
dabbler 2012.04.29 11:28 #
 

This will help to translate the Russian comments ...

http://forum.mql4.com/45641#572553


avatar
14
avatar
146
erzo 2012.04.29 12:20 #
 

The most important is

for (SH=0;SH<NB;SH++)

that you forgot. The original SH=1 disables to show signals at the [0] bar, and intended to hide all the repainting scam.

 
avatar
14
william.teo 2012.04.29 13:38 #
 

Erzo,

Thanks for the super fast help.

It is still not working.

Why is it that it works on charts and not on the Strategy Tester??

Anyway, you guys are real experts - just a glance and you know straight away the problems and what the program is up to...

Thank you.

 
avatar
146
erzo 2012.04.29 13:58 #
 

william.teo:

It is still not working.

Maybe you misunderstood me, by "not an indicator" I thought that it repaints, and not only the last signal, but it is an indicator officially.
Try the following. Start the tester on another EA, that not trading much, with visual mode (I use MACD Sample for that). When the tester starts running it's chart, drop the indicator into it and watch what the indicator paints. (MACD Sample will buy and sell, but don't care about it.)

 
Back to topics list   | 1 2  

To add comments, please log in or register