Machine learning in trading: theory, models, practice and algo-trading - page 670

 
Renat Akhtyamov:
i=i+2, not i++

Well, at each tick I just have a zero indicator buffer recalculated and that's it

 
Maxim Dmitrievsky:

Well, at each tick I just have a zero indicator buffer recalculated and that's it

Nonsense, I haven't noticed that in this case

 
Renat Akhtyamov:

nonsense, did not notice that

Maybe because the response from the scaffolding is slow, and while the buffers are filled, it does not output values? I dunno

not critical, but unpleasant

 
Nikolay Demko:

Show me the code.

I sent it in my personal, so that no one could copy it)

 
Maxim Dmitrievsky:

What is the backtest and forward bot?

I am testing with virtual trading, I have sent you the lib once. I have been testing it for the second week and I like the results. But I will not show it to you for now not to jinx it.)

Elibrarius:
And even more interesting to see the signal)

The signal was shown earlier. It is the MA of the 2nd period on the reversals and its modification as a filter.
In the two-class classification the forecast also gives signals, but it is worth trading only when filtering reversals.
The three-class classification is not instantaneous. However, the result is clearer, as you can see. Visually the number of classes is not equal but similar.
Code:

double iBouncedMA(const int bar, 
                  const string symbol = NULL, const int period = PERIOD_CURRENT,
                  const int mode = MODE_EMA, const int emaPeriod = 2)
{   // Generate signals for ML ©Aleksey Terentyev 2017-2018
    if( bar >= Bars-2 || 2 >= bar ) {
        return 0.0;
    }
    double ema1, ema0, ema_1, ema_2, result = 0.0;
    ema1 = iMA(symbol, period, emaPeriod, 0, mode, PRICE_OPEN, bar+1);
    ema0 = iMA(symbol, period, emaPeriod, 0, mode, PRICE_OPEN, bar);
    ema_1 = iMA(symbol, period, emaPeriod, 0, mode, PRICE_OPEN, bar-1);
    ema_2 = iMA(symbol, period, emaPeriod, 0, mode, PRICE_OPEN, bar-2);
    if( ema0 < ema_1 ) {
        result = 1.0;
        if( ema1 < ema0 ) {
            result = 0.95; // 0.5
        }
        if( ema_1 > ema_2 ) {
            result = 0.0;
        }
    } else if( ema0 > ema_1 ) {
        result = -1.0;
        if( ema1 > ema0 ) {
            result = -0.95; // -0.5
        }
        if( ema_1 < ema_2 ) {
            result = -0.0;
        }
    }
    return result;
};

double iBouncedMAFiltered(const int bar, 
                          const string symbol = NULL, const int period = PERIOD_CURRENT,
                          const int mode = MODE_EMA, const int emaPeriod = 2,
                          const int filterPeriod = 5)
{   // Generate signals for ML ©Aleksey Terentyev 2017-2018
    double bounce = iBouncedMA(bar, symbol, period, mode, emaPeriod);
    double filter0 = iMA(symbol, period, filterPeriod, 0, MODE_SMA, PRICE_CLOSE, bar-2);
    double filter1 = iMA(symbol, period, filterPeriod, 0, MODE_SMA, PRICE_CLOSE, bar-1);
    if( bounce > 0.0 ) {
        if( filter1 < filter0 || MathAbs(bounce) == 1.0 ) {
            return bounce;
        }
    } else if( bounce < 0.0 ) {
        if( filter1 > filter0 || MathAbs(bounce) == 1.0 ) {
            return bounce;
        }
    }
    return 0.0;
};
 
Aleksey Terentev:

I am testing with virtual trading, I once sent you the libu. I have been testing for the second week, I like the results. But I will not show them yet, so as not to jinx them.)

I don't want my photons to spoil it :)

I have also finalized the indicator to my liking, so I'll test the bot soon

 

I'm reading a book.

Elliott_Timmermann.A_handbook_of_economic_forecasting

The readings are:

1. Why the difficulty with forecasting?

  • model uncertainty
  • parameter instability


2. What to do?

  • Economically sound constraints on model parameters
  • Combining forecasts
  • Adding synthetic tools (in the book - principal components, indices)
  • Regime shifts
 
SanSanych Fomenko:

I'm reading a book.

Elliott_Timmermann.A_handbook_of_economic_forecasting

The readings are:

1. Why the difficulty with forecasting?

  • model uncertainty
  • parameter instability


2. What to do?

  • Economically sound constraints on model parameters
  • Combining forecasts
  • Adding synthetic tools (in the book - principal components, indices)
  • Mode shifts.

Everything works smoother in the stock market/indices, and interrelationships are good.

Forex is the tightest market in this respect.

 
Maxim Dmitrievsky:

In the stock market, everything works more evenly, and there are good interdirectional correlations.

Forex is the tightest market in this respect.

And why bother if the stock/index market is easier? Go to the stock market - futures, options. Everything is easier, you say. Or you can't part with MT? ))

There are many who say that the conditions at the stock exchange are worse. Do you know why? The leverage is smaller, which means there is nothing to do there with $.00. I think that with $100 there is nothing to do on the Forex market either.) On the other hand, if you lose, it's kind of a pity.) If you win, it's a pittance, but it's nice.

 
For example, ifI were to buy a Colombian, I would be very disappointed if I were to buy a Colombian wallet:

And why bother if the stock/index market is easier? Go to the stock exchange - futures, options. Everything is easier, you say. Or you cannot part with MT? ))

There are many who say that the conditions at the stock exchange are worse. Do you know why? The leverage is smaller, which means there is nothing to do there with $.00. I think that with $100 there is nothing to do on the Forex market either.) On the other hand, if you lose, it's kind of a pity.) And if you win - a trifle, but pleasant.

If you win, it's nice to win. If you lose, it's not worth it, and if you win, it's good to win.

And in general multicurrencies are prescribed for MO because the signs are real fundamentally grounded.

When I started to trade on the futures market, I tried to think about the difference between the two types of MT5, but now I don't know how to fill it up, because MT5 is connected to European CQG and AMP servers are not co-located with the exchange.

Reason: