Absolute opposition - page 6

 
Ivan Vagin:
The prerequisite for publication was that someone had to code the algorithm and post the code here, while I'm in the hospital, but everything is still at the level of slogans.

And this story has a sequel, but probably no one will ever know it... including those who quietly coded it for themselves :-)
One always has a hope, and maybe, well, this time, ah ... well, next time!
 
Boris:
There's always hope, what if, well, this time, ah... well, next time!
It's a law of nature, even those who learn to surf think so, some give up, some succeed.
 
Ivan Vagin:
It's a law of nature, even those who learn to surf think so, some give up, some succeed.

In surfing, the only thing that gets in your way is your ineptitude!

But here, when you do know how, the system rules!

 
Boris:

In surfing, it's only your inability that prevents you from surfing!

But here, when you know how, the system rules its own way!

What do you know how to do?

I don't think the market is any harder than the sea.
 
Ivan Vagin:
What can you do?

I don't think the market is any harder than the sea.
Exactly, but there's a lot of stuff that borders on financial crime!
 
Dmitry Fedoseev:
Where are the results?

I'll post it soon.

Question withdrawn, message erased.

---- roulette colours

https://otvet.mail.ru/question/9344746

 

Here's the script

Here's the script, as promised. The results are as expected. The script is attached at the bottom of the post.

Ivan, what to do with the depo when zeros and not our colour come out? I subtracted the last lot size from the depo before changing it.

//+------------------------------------------------------------------+
//|                                                     Roulette.mq4 |
//|                               Copyright 2015, Alexey Volchanskiy |
//|                                          https://mql.gnomio.com/ |
//| Autor of idea is Ivan Vagin at 2015.12.07 04:40                  |
//| see https://www.mql5.com/ru/forum/68328                          | 
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, Alexey Volchanskiy"
#property link      "https://mql.gnomio.com/"
#property version   "1.00"
#property strict
#property script_show_inputs

enum EFields {EZero, EBlack, ERed};

extern EFields  StartField  = EBlack;   //Цвет первой ставки    
extern double   MinLot      = 1;      //Минимальный лот
extern double   StartDepo   = 1000;     //Стартовый депозит
extern uint     Iterations  = 1000;     //Количество итераций
extern bool     PrintEnable = true;     //Печатать итерации

const int ARed[] = {1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36};
double MaxLot = 0, MaxDepo = 0, MinDepo = 1 e99;
uint NZero = 0, Nred = 0, Nblack = 0;

/*-----------------------------
Поскольку одна ячейка - это примерно 2,7% колеса рулетки, именно такой процент хозяева казино 
кладут себе в карман в среднем с каждой сделки, медленно выкачивая деньги из клиентов.
----------

Алгоритм ставок в том виде, как написал Ivan Vagin 2015.12.07 04:40 

1 Ставим минимальную ставку на цвет из настроек
2 Запускаем рулетку
(Если) выпал наш цвет то 3 если не наш то 4 если выпал 0 то 5
3 Забираем удвоенную прибыль и ставим минимальную ставку на другой цвет
4 Удваиваем ставку на тот же цвет
5 Удваиваем ставку и меняем цвет ставки

Далее 2 пока не кончится количество итераций
Если кончилось количество итераций то конец
----------
Что хотелось бы видеть на выходе.... ну кроме прироста депозита, соотношение прибыльных и убыточных, самые длинные последовательности красного/черного/нуля в последней серии итераций,
показательна была бы кривая эквити

-----------------------------*/
#define  PRINT if(PrintEnable) Print("iteration=", iter, "  result=",  result, "  lastField=", lastField,  "  depo=", depo, "  lot=", lot);
#define  PRINTEND Print("iteration=", (iter-1), "  depo=", depo, "  MinDepo=", MinDepo, "  MaxDepo=", MaxDepo, "  MaxLot=", MaxLot, "  NZero=", NZero, "  Nred=", Nred, "  Nblack=", Nblack);

void OnStart()
{
    Print(0 % 36, "  ", 1 % 36, "  ", 37 % 36);
    uint iter = 0;
    EFields lastField = StartField;
    double lot = MinLot, depo = StartDepo;
    
    MathSrand(GetTickCount()); 
    while(iter++ < Iterations && depo > 0)
    {
        EFields result = Spin();

        if(result == EZero) //5 Удваиваем ставку и меняем цвет ставки
        {
            depo += lot*1; //??????? что тут делать с прибылью? 
            lot *= 2;
            PRINT
            if(MaxLot < lot)
                MaxLot = lot;
            if(MaxDepo < depo)
                MaxDepo = depo;
            NZero++;            
            lastField = (lastField == ERed)? EBlack: ERed;  
            continue;
        }    
        if(result == lastField) // 3 Забираем удвоенную прибыль и ставим минимальную ставку на другой цвет
        {
            depo += lot*2; 
            lot = MinLot;
            if(MaxDepo < depo)
                MaxDepo = depo;
           
            PRINT
            if(lastField == ERed)
            {
                lastField = EBlack;
                Nred++;    
            }    
            else
            {
                lastField = ERed;
                Nblack++;
            }    
            continue;
        }    
        else
        {
            depo -= lot; 
            if(MinDepo > depo)
                MinDepo = depo;
            lot *= 2;
            if(MaxLot < lot)
                MaxLot = lot;
            uint n = (lastField == ERed)? ++Nred: ++Nblack;    
            PRINT
        }
    }
    PRINTEND   
}

EFields Spin()
{
    int result = MathRand() % 36;
    if(result == 0)
        return EZero;
    for(int n = 0; n < 18; n++)    
        if(result == ARed[n]) 
            return ERed; 
    return EBlack;
}
Files:
Roulette.ex4  10 kb
Roulette.mq4  5 kb
 
Alexey Volchanskiy:

Here's the script.

Who wants dough for New Year's Eve? Here are the results of one of the tests ))

2015.12.09 00:55:46.757 Roulette EURUSD.e,M5: iteration=10000 depo=66927.0 MinDepo=1001.0 MaxDepo=66927.0 MaxLot=16384.0 NZero=260 Nred=4969 Nblack=4771

MinLot = 1; //minimal lot
StartDepo = 1000; //Start deposit
Iterations = 10000; //Number of iterations

-----------------

I had to put the red numbers into an array, as the colours and even/odd don't match, data from here https://otvet.mail.ru/question/9344746

const int ARed[] = {1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36};
 
Alexey Volchanskiy:

Here's the script.

Ivan, what to do with the depo when zeros roll and not our colour? I subtracted the last lot size from the depo before changing it.

of course "give back to the casino", I can only look it up on the computer now if I understand

Generally speaking, the bet is "burned" if it's zero or not our colour.

You have a common black and red count.

and you can count the longest sequences of black and red
 
For those who suffer, I will stress once again that martin in the form in which it is used by most traders inevitably leads to a loss, the main reasons are three

Excessively large initial lot

Excessive martin ratio

small deposit


although this is probably all the same thing from different angles - improper money management

Reason: