Stochastic indicator. A curious observation. - page 3

 
Aleksey24:
SK. wrote (a):

Not. 99/1.

- "Stochastic has a nasty property of changing its values retroactively"?


I didn't quite get it right.

Actually the values change retroactively if the last few bars are recalculated.

If only 0-bar is calculated, then everything is OK.

You can clearly see it if you display for example Stochastic from MN1 to W1.

Too bad I can't make a video for the forum, otherwise I would have shown you.

99/1 Forever.

If you do not know what they show, you may be mistakingly preparing multitemporal indicators or do not understand what they show.

 
Why are you testing on zero bar? Right on the first one it seems. Otherwise it's self-defeating.
 
igor00:
Why are you testing on zero bar? It's correct to do it on the first bar. Otherwise it's self-defeating.

On H4 while you wait for the bar to close, the price will already leave. So, it is not necessarily on the first bar.
 

How can I make indicators called from an Expert Advisor be drawn during visual testing?
All indicators are displayed after the end of test. :(

#property copyright "Copyright © 2007, Aleksey24"
#property link      "grailholder.blogspot.com"
 
extern int WorkPeriod        =PERIOD_MN1;
 
extern int StochasticKperiod1=5;//5
extern int StochasticDperiod1=3;//3
extern int StochasticSlowing1=3;//6
 
int init()
  {
   return(0);
  }
int deinit()
  {
   return(0);
  }
int start()
  {
   iStochastic(NULL,NULL,StochasticKperiod1,StochasticDperiod1,StochasticSlowing1,MODE_SMA,0,MODE_MAIN,0);
   iCustom(NULL,NULL,"MY_Stochastic_Period",WorkPeriod,StochasticKperiod1,StochasticDperiod1,StochasticSlowing1,0,0);
   return(0);
  }
Files:
 
Run the non-visual test for half a second, open the chart - it will have all the indicators with settings, save the tester template.
 
igor00:
Why do you test on the zero bar? It's right on the first bar. Otherwise it is a self-deception.

Not on the bar. On ticks the Expert Advisor works.

And here is the result of run with parameters "by eye" on GBPUSD, M15

"Same eggs, but from the side". Percentage of profitable trades on long and short positions approximately remains different!

Symbol GBPUSD (Great Britain Pound vs US Dollar) 15 Minutes Period (M15) (2006.01.01 - 2007.08. 31)

Model All ticks (based on .

. Simulation quality 90.00% Initial deposit 10000.00

Net profit 2911.62

Total profit 17215.70 Total loss -14304.08

Profitability 1.20 Expected payoff 5.48

Absolute drawdown 41.14 Maximum drawdown 871.00 (6.87%) Relative drawdown 6.87% (871.00)

Total trades 531

Short positions (% win) 267 (44.94%)

Long positions (% win) 264 (53.03%)

Profitable trades (% of all) 260 (48.96%)

Loss trades (% of all) 271 (51.04%)

The most profitable trade 138.00 Loss trade -67.70

Average profitable trade 66.21 losing trade -52.78

 
leonid553:

Either on the Sell positions you have to take the mirror version of the stochastic.

Generally speaking, purely mathematically, the "inverted" mirror version should be identical to the "straight" one. If there is a significant difference, we will need to investigate the indicator code very carefully.
 
How hard can it be to write
sumlow+=HighesBuffer[k]-Close[k];
sumhigh+=HighesBuffer[k]-LowesBuffer[k];
instead of the original
sumlow+=Close[k]-LowesBuffer[k];
sumhigh+=HighesBuffer[k]-LowesBuffer[k];
and compile?
We will get a mirror copy. We do not get anything new for it will be the same but in a mirror image.
In order to get a new stochastic we need a new formula, and until it is absent, there is no sense in twisting it back and forth, there will be no result.
 

I haven't looked at the stochastic code :). If I have a difference of more than 2-3% between buy and sell I start looking for an error in the EA code. And I usually find one. So something is probably done incorrectly or there is a bug in this case. It is unlikely but possible that this is a bug in MQL. That is what is of interest.

 
Shinigami, thank you

for the recommendation.

But how is it that we "get nothing new"? On the contrary. Of course it is difficult to see with the naked eye, there may be differences. But there is a difference. Here's the difference.

I mentioned the expression "dynamic range of the indicator" at the beginning of the thread for a reason. Not only it is unipolar, but stochastic also draws the price movement up and down within this range at different speed. In a simplified manner, the matter is as follows:

The calculation goes from zero and when price rises from its low the stochastic slowly increases. As price continues to move upwards, the stochastic increases too! Even if price is moving very slowly upwards.

The price has reached its high. And then it went down. And the stochastic follows it. But unlike the rise, the pattern here is reversed! At the beginning stochastic is moving downwards as fast as possible, and its speed is gradually decreasing as the price reaches its minimum!

In other words, the stochastic starts its upward and downward movement with different accelerations. Upwards - slowly and gradually speeding up. Downwards - very fast and gradually slowing down

There it is - asymmetry! AND ALL THIS I HAVE SAID IS CONFIRMED BY THE GRAPH ON THE PREVIOUS PAGE. PAGE. The envelope width is different in upper and lower positions of the indicator!

I did it as I could.