Stochastic indicator. A curious observation. - page 2

 

Mm)

 
I wish I could find the Classic Stochastic from Omega Tradestation 2000i.
 
igor00:
I wish I could find the Classic Stochastic from Omega Tradestation 2000i.
Here you go:
{*******************************************************************
Description : This Indicator plots a Stochastic with adjustable %K & %D
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Input: Length(5), KAdjust(3), DAdjust(3), OverBought(80), OverSold(20);
Variables: KAdjusted(0), DAdjusted(0);

KAdjusted = SlowKClassic(KAdjust, Length);
DAdjusted = SlowDClassic(DAdjust, Length);

IF CurrentBar > Length Then Begin
Plot1(KAdjusted, "%K");
Plot2(DAdjusted, "%D");
End;
Plot3(OverBought, "OverBought");
Plot4(OverSold, "OverSold");

{Alert Criteria}
If Plot1 > OverBought Then
Alert("The %K line is in overbought territory").
Else
If Plot1 < OverSold Then
Alert("The %K line is in oversold territory");

{Stochastics Expert Commentary}
#BeginCmtry
Commentary(ExpertStochastic(Plot1, Plot2, Plot3, Plot4));
#End;

{*******************************************************************
Description : This Function returns Slow Stochastic %K Classic
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: FastKLen(NumericSimple), Length(NumericSimple);

SlowKClassic = Average(FastK(FastKLen), Length);


{*******************************************************************
Description: Fast Stochastic %K
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Length(NumericSimple);

Value1 = Lowest(Low, Length);
Value2 = Highest(High, Length) - Value1;
Value3 = Close;

If Value2 > 0 Then
FastK = (Value3 - Value1) / Value2 * 100
Else
FastK = 0;

{*******************************************************************
Description : This Function returns Slow Stochastic %D Classic
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: FastKLen(NumericSimple), Length(NumericSimple);

SlowDClassic = Average(FastDClassic(FastKLen), Length);

{*******************************************************************
Description : This Function returns FastDClassic
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs : KLength(NumericSimple);

FastDClassic = Average(FastK(KLength), 3);
 
SK. писал (а):

Not. 99/1.

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


I didn't quite put it that way.

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.

 
It always turns out that the number of profitable trades of long positions is up to 80%

А из коротких, - в лучшем случае, - 50/55 %.

.

And this is true for entries on the signal line, overbought/oversold levels, and even on iOnArray...

The conclusion is that when using the Stochastic, parameters for buy and for sell should be set separately. I.e. apply two indicators.

The conclusion is actually debatable.

Long positions are generally more successful, because there is a long-term upward trend. Stochastic has nothing to do with it.

 
Topor:
It always turns out that the number of profitable trades of long positions is up to 80%.

And of the short ones - at best 50/55%.

And this is true for the entries by the signal line, and by the overbought/oversold levels, and even by iOnArray...

The conclusion is that when using Stochastic, parameters for buy and for sell should be set separately. I.e. apply two indicators.

The conclusion is actually debatable.

Long positions are generally more successful because there is a long-term upward trend. Stochastic has nothing to do with it.

IMHO from the controversial conclusion we can draw another conclusion: Forex is asymmetric. If so, then you can make a trading system that has separate signals for long and short positions and separate optimization of these signals.

We already have a successful trading system based on the principles of asymmetric market. Article: Non-standard automatic trading'.
 
Topor:
It always turns out that the number of profitable trades out of long ones is up to 80%.

And of the short ones - at best 50/55%.

And this is true for the entries by the signal line, and by the overbought/oversold levels, and even by iOnArray...

The conclusion is that when using Stochastic, parameters for buy and for sell should be set separately. I.e. apply two indicators.

The conclusion is actually debatable.

Long positions are generally more successful, because there is a long-term upward trend. Stochastic has nothing to do with it.

It has nothing to do with it! I've emphasized that the trend is present in almost all the pairs! Both in pairs that have been trending in the past year or two (yen) and in pairs that have been moving in different directions. What could be the long-term trend on GBPCHF, for example? And others like that?

The trend is on all pairs !

 
usdjpy:
IMHO from the controversial conclusion we can draw another conclusion: Forex is asymmetric. If so, then you can make a trading system that has separate signals for long and short positions and separate optimization of these signals.

We already have a successful trading system based on the principles of asymmetric market. Article: Non-standard automatic trading'.



Indeed. Provided separate signals in my Expert Advisor from the first post. And the number of profitable trades is almost equal for long and short positions.
 
leonid553:
usdjpy:
IMHO from the controversial conclusion we can draw another conclusion: Forex is asymmetric. If so, then you can make a trading system that has separate signals for long and short positions and separate optimization of these signals.

We already have a successful trading system based on the principles of asymmetric market. Article: Non-standard automatic trading'.



Indeed. Provided separate signals in the EA from the first post. And the number of profitable trades is almost equal for long and short positions.
If you don't mind! Can I see the result?
 

Paha, I can't find the parameters with which I got that result. I can't even remember the total profit. I have not even remembered the total profit.

I was surprised to find out after the optimization that the number of profitable deals on short positions is still less than 52% ! And on long positions it sometimes reaches 75% !

I am knocked down! I cannot restore those parameters. I have tried everything in the tester. No way! Maybe, indeed, GBPUSD has been trending for the last years. Either on Sell positions we should take a mirror version of stochastic. I should enter magics in the "comments" of the tester for long and cor. positions and deal with them.

And I will post the result after optimization.

GBPUSD (Great Britain Pound vs US Dollar) Period 4 Hour (H4) 2006.01.02 00:00 - 2007.08. 31 00:00 (2006.01.01 - 2007.08.31) Model All ticks (based on ...

Simulation quality 90.00%

Initial deposit 10000.00

Net profit 4188.54

Profitability 1.70 Expected payoff 16.11

Absolute drawdown 141.02 Maximum drawdown 355.32 (2.57%) Relative drawdown 2.86% (341.00)

Total trades 260

Short positions (% win) 132 (50.76%)

Long positions (% win) 128 (65.63%)

Profitable trades (% of all) 151 (58.08%) Loss trades (% of all) 109 (41.92%)

Most profitable trade 130.00 Loss trade -60.56

Average profitable trade 67.34 losing trade -54.86

Maximal number of continuous wins (profit) 7 (316. 22) continuous losses (loss) 5 (-233.58)

Optimized only Stochastic periods for long and short positions. And stops. Trailing stop has not been optimized.

int start()
  {
//*********************************************************************
// для покупки
double StochK_0=iStochastic(NULL, 0, K_period,D_period,3,MODE_SMA,0,MODE_MAIN, 0);
double StochK_1=iStochastic(NULL, 0, K_period,D_period,3,MODE_SMA,0,MODE_MAIN, 1);
double StochD_0=iStochastic(NULL, 0, K_period,D_period,3,MODE_SMA,0,MODE_SIGNAL, 0);
// для продажи
double _StochK_0=iStochastic(NULL, 0, K_period_,D_period_,3,MODE_SMA,0,MODE_MAIN, 0);
double _StochK_1=iStochastic(NULL, 0, K_period_,D_period_,3,MODE_SMA,0,MODE_MAIN, 1);
double _StochD_0=iStochastic(NULL, 0, K_period_,D_period_,3,MODE_SMA,0,MODE_SIGNAL, 0);
Reason: