To follow up - page 2

 

To follow up on the 'silent' Stochastic.

A few changes:

1. corrected not so much an error... ...some inconsistency or something. When changing this parameter, due to peculiarities of calculation of deceleration (Slowing), the stochastic's sensitivity "sagged", and it had to be scaled manually. Fixed. In the function, a line multiplying sensitivity by deceleration was simply introduced (see in the code).

2. A check for sufficiency of bars for search of extrema in an array was added (in the function). It was not a big deal - there was just a warning in the log but it was ok. It is not "fighting" now.

// стохастик с шумодавом
double Stoch(int Kperiod, int Slowing, int PriceFild, double sens, int i) {  
   if( i+ Kperiod+ Slowing>Bars) return(-1); // недостаточно баров - выход (2)
   // экстремумы цены в цикле замедления/сглаживания
   double max, min, c;
   for(int j= i; j< i+ Slowing; j++) {
      if( PriceFild==1) { // по Close
         max+=Close[ArrayMaximum(Close, Kperiod, j)];
         min+=Close[ArrayMinimum(Close, Kperiod, j)];
        }
      else { // по High/Low
         max+=High[ArrayMaximum(High, Kperiod, j)];
         min+=Low[ArrayMinimum(Low, Kperiod, j)];
        }
      c+=Close[ j];
     }
   // шумоподавление
   sens*= Slowing; // приведение чувствительности в соответствие с периодом замедления (1)
   double delta= max- min; // размах
   double diff= sens- delta; // разница между порогом чувств. и размахом
   if( diff>0) { // если разница >0 (размах меньше порога), то
      delta= sens; // размах = порогу,
      min-= diff/2; // новое значение минимума
     }
   // вычисление осциллятора
   if( delta==0) return(-1);
   else return(100*( c- min)/ delta);
  }

3. I mentioned in the comments to this post that I could make the sensitivity threshold a function of ATR. Done. Added appropriate two fields:

Volatility - if greater than 0, the smoothing period for ATR; if set to negative values, the sensitivity will be bound to StDev. I don't like to enter additional fields.

xVolatility - multiplier for Volatility.

From top to bottom: (1) stochastic, where ATR(66) x 4 acts as threshold; (2) threshold is set rigidly at 10p; (3) pure stochastic.


Files:
 
lna01 >> :

But if it's really "maybe not academic", I'd listen.

So I'm not going to hide it.)) Unless, of course, I come up with something in that direction.

Interesting, interesting. Although I confess I have some initial scepticism.

By the way, real formalisation means being able to check against history, have you done that?

As a matter of fact, my swindroids using this approach are trading. So...

Here's the thing. Of course, I'm not going to post the bot with the statment. I would be interested in discussing the approach itself, but for this purpose it would be necessary to make tools which at least merge them into a file to be able to analyze newly created rows. I don't have that at the moment. I have to prepare myself.

 
lna01 писал(а) >>

I have formulated a kind of theorem for myself: For any (liquid) market, for any zigzag, the average slippage will be about 1/2. It can hardly be proved, but a single fact would suffice to disprove it. So my interest, and rightly so, is rather academic :) .

Pastukhov has researched it. True, it is based on Renko or Kaga, but it is the same with ZZ as well. Basically, it all comes down to Hearst. More than 0.5 is trendy, less is flat. The average hospital temperature is 0.5 on liquids. Otherwise it would be simple :) And so we need a context, when we trade a trend and when we trade a flat.
 
Svinozavr >> :

In fact, my swindroids using this approach are trading. So.

The point here is this. Of course, I'm not going to post the bot with the statment. For this purpose for analysis of newly obtained series we should create tools that would at least merge them into a file. I don't have that at the moment. I have to prepare myself.

What matters here is the time, the total number of trades and whether manual changes have been made to the parameters. However, this is not the most important question. The bot with the statement should not be published under any circumstances - the public will gather in a great multitude and it will be impossible to discuss the subject at all :) .

But if you don't like it, don't worry.

Avals >> :
Pastukhov researched it. It's true, his method is based on Renko or Kaga, but it's the same with ZZ as well. As a matter of fact it all comes down to Hurst. Above 0.5 we are trending and below 0.5 we are flat. The average hospital temperature is 0.5 on liquids. Otherwise it would be simple :) And so we need context, when we trade a trend and when we trade a flat.


Yes, I am aware of Pastukhov. As I remember he justified the value of 1/2 as a watershed between pullback and breakout trading for one particular zigzag. "The theorem is equivalent to the impossibility to create a trade-sufficient zigzag, i.e. it is more general. However, to go to this more general hypothesis requires not so much genius as pessimism :). Nevertheless, I believe it is useful to check each new zigzag by this criterion :)



Note, it is the refutation of the "theorem" that is being proposed now. Since a zigzag with the correct context definition built in would be self-sufficient for trading :)

 

Can you please tell me how to correct data entry in iCustom for using indicator in Expert Advisor?

ZZ=iCustom(Symbol(), 0, "ChanneliMACD_ATR", ..., ..., ..., 0, 0);

Thank you.

 
skifodessa >> :

Can you please tell me how to correct data entry in iCustom for using indicator in Expert Advisor?

ZZ=iCustom(Symbol(), 0, "ChanneliMACD_ATR", ..., ..., ..., 0, 0);

Thank you.

iCustom
  (
   NULL,0,"_Channel@MACD_ATR", // на текущем инструменте и т-ф
   FastMA,SlowMA,SlowMAshift,Method, // параметры МАшек
   ATR,xATR,Sens, // параметры чувствительности
   ChannelMA,Border, // параметры канала
   ShowTrend,ShowChannel,ShowZigZag,ShowFibo, // параметры отображения
   n, // номер буфера
   i // сдвиг буфера
  );

Buffers (n).

0, 1 - peak, trough of ZigZag.

2, 3 - upper, lower limits of raw channel.

4, 5 - upper, lower borders of the smoothed channel.

6 - trend line.

===

The name of the induke is saved incorrectly when attached to the post for some reason. I have it originally called _Channel@MACD_ATR, but the @ has been replaced with some bullshit. So be more careful when naming it in iCustom.

 

To follow up on the 'silent' Stochastic.


The link doesn't work

 
_my/ remove it from the link, poruchik.
 
That's weird. What is _my/? I don't have anything and it opens everything. (Red Fox 3.0.6)
 

А... No. I'm lying. It's because I copied the link through "my scripts". I should open them and take them from the browser bar. Good to know.

===

Nah, it's still with _my/. Anyway, fixed the link manually. (It's weird, though.)