Profit from a random price range - page 8

 
avatara:

The topic deserves to be discussed further, as far as I'm concerned. Time has passed - there was a lot to think about and learn.

Especially the Fisher Transform is sort of described...

;)

I whipped up two scripts for generating test series. (for uniform and normal increments).

Please don't kick for necromancy and sloppiness in rushed code...

The Fisher Transform, like any other expander, wildly amplifies fractional noise near the upper and lower bounds of the interval, and in the limit (at the boundary itself) with an infinite factor. For the market this is just relevant - all prices are quantized by Point, and hence to some extent all indicators are also quantized by Point.
 
NorthernWind:

However, if you play as I suggested in the link above, you can surely win on random walks with mo=0. But, once again, this is not exactly the game we are told about in the theorems. Moreover, there is a paradoxical situation, such that the more times you fail to guess, the more you earn. Once again, this game has nothing to do with reality and is intended to demonstrate the importance of accurate testing. The point is that the winnings there are accumulated by undercounting the bets won and lost. That's right.

If you manage to play a game like I suggested, you will definitely get rich. :) And I should add that distribution in this game also makes a big difference. The game is simply not feasible on some kinds of random wandering.

ZS. Without regard to what has been discussed, if you convert the existing distribution to another then you can indeed have an advantage at times, but a very shaky one.

If you get the idea right, sketched out the code for a quick test of it on "prices" with a normal distribution of increments:

#property strict

extern int AmountPrices = 10000;
extern int TakeProfit = 100;
extern int StopLoss = 100;
extern double point = 0.0001;
extern int Temp = 0;

#define  MAX_RAND 32767.0

double GetRand()
{
  return(2 * MathRand() / MAX_RAND - 1);
}

void GetRandGauss( double& Rand1, double& Rand2 )
{
  double X1, X2, W = 2;
  
  while (W >= 1)
  {
    X1 = GetRand();
    X2 = GetRand();
    
    W = X1 * X1 + X2 * X2;
  }
  
  W = MathSqrt(-2 * MathLog(W) / W);
  
  Rand1 = X1 * W;
  Rand2 = X2 * W;
    
  return;
}

void GetPrices( double &Prices[], int Amount )
{
  static uint Tmp = 0;
  double Rand1, Rand2;
  
  MathSrand((int)TimeLocal() + Tmp);
  
  Amount <<= 1;
  
  ArrayResize(Prices, Amount);
  
  Prices[0] = 0;
  
  for (int i = 2; i < Amount; i += 2)
  {
    GetRandGauss(Rand1, Rand2);
    Prices[i - 1] = Prices[i - 2] + Rand1;
    Prices[i] = Prices[i - 1] + Rand2;    
  }
  
  Tmp += GetTickCount();
  
  return;
}

void NormalizeArray( double &Array[] )
{
  const int Size = ArraySize(Array);
  const double Interval = ArrayMaximum(Array) - ArrayMinimum(Array);  
  
  for (int i = 0; i < Size; i++)
    Array[i] /= Interval;
    
  return;
}

double System( const double &Prices[], const double TP, const double SL )
{
  const int Amount = ArraySize(Prices);
  bool Flag = TRUE;
  double OpenPrice = Prices[0];
  double Balance = 0;
  
  for (int i = 0; i < Amount; i++)
  {
    if (Flag)
    {
      if ((Prices[i] >= OpenPrice + TP) || (Prices[i] <= OpenPrice - SL))
      {
        Balance += Prices[i] - OpenPrice;
        
        Flag = (MathRand() > (SHORT_MAX + 1) / 2 - 1);  
        OpenPrice = Prices[i];
      }
    }
    else if ((Prices[i] <= OpenPrice - TP) || (Prices[i] >= OpenPrice + SL))
    {
      Balance -= Prices[i] - OpenPrice;

      Flag = (MathRand() > (SHORT_MAX + 1) / 2 - 1);  
      OpenPrice = Prices[i];
    }
  }
  
  return(Balance);
}

double GetRandProfit( int Amount, const double TP, const double SL )
{
   double Prices[];
   
   GetPrices(Prices, Amount >> 1);
   NormalizeArray(Prices);
   
   return(System(Prices, TP, SL));  
}


double OnTester( void )
{
  return(GetRandProfit(AmountPrices, TakeProfit * point, StopLoss * point));
}

Optimization (take and loss) by custom criterion has already clearly shown the expected failure of the ancient myth (or mine).

 
hrenfx:

If I get the idea right, sketched out the code for a quick check on "prices" with a normal distribution of increments:

Optimization (take and loss) by custom criterion has already clearly shown the expected failure of the ancient myth (or mine).

Sir, your lady has left relatively recently.
 
hrenfx:

If I get the idea right, sketched out the code for a quick check on "prices" with a normal distribution of increments:

Optimization (take and loss) by custom criterion has already clearly shown the expected failure of the ancient myth (or mine).

myth of what?
 
ZaPutina:
myth of what?

Some uncles have argued about the possibility of creating a profitable TS on generated SB prices (more specifically, increments with a normal distribution). Formalised the TS, did a lot of research...

Came out to this, thanks to a private discussion relating indirectly to this topic. For, perhaps, sometime in the future a skeptic, decided to sketch in the public domain some code-checking nobody needs.

 

for dickfks , can't you try a different distribution? for example, a market price (artificially generated). and as a starter, on which distribution can you make a profit?



 
YOUNGA:

For dickfks, could you try another distribution? for example, the market price (artificially generated). and for starters, what distribution can be used to make a profit?

Guaranteed profits can be squeezed out at "fluffy" prices. The definition of fluffiness and the formalisation of the TS for this will not be given. Perhaps somewhere else. All this has little to do with real trading.

The code can be modified to suit any distribution. To do this you just need to replace function GetRandGauss with the quantile function of the desired distribution - it converts uniformly distributed (MathRand) random variable to the corresponding distribution.

 
hrenfx:

Guaranteed profits can be squeezed out at "fluffy" prices. The definition of fluffiness and the formalisation of the TS for this will not be given. Perhaps somewhere else. All this has little to do with real trading.

The code can be modified to suit any distribution. To do this, just replace function GetRandGauss with function of quantile of desired distribution - it converts uniformly distributed (MathRand) random variable to the corresponding distribution.

Are you saying your code goes through ALL possible choices with 100 lines or less? Since it doesn't, what does it have to do with proving that you can't make money on pseudo SB (there is no pure SB in nature).
 
ZaPutina:
You mean your code goes through ALL possible variants with no more than 100 lines? And since it doesn't, what does it have to do with proving that you can't make money on pseudo SB (there is no pure SB in nature).

Change the white noise to the distribution function of interest and check if you want to. Only this is nonsense: to prove that you can't make money. Prove otherwise.

ZZY Speaking of the random nature of the market: its current state(closing price today) was predetermined on 23.03 at 19:00+3:00 Moscow time.

 
tara:

Change the white noise to the distribution function you are interested in and check if you want to. Only this is nonsense: to prove that you can't make money. Prove otherwise.

Speaking of the random nature of the market: its current state (closing price today) was predetermined on 23.03 at 19:00+3:00 Moscow time.

With you only through your son-in-law...no disrespect.