Morse code - page 7

 
Also, if you have any ideas which stats/indicators might be useful in trading, post them here.

Just to give you an idea :

1. number of reversals of X pip in a selected area
2. the same number but no flips in size of N * X pips
3. Volumes, at least in ticks
 

It would be interesting to look at the part of the code that makes calculations, just for fun ....

As for the ideas, I would look at the candles formed by the delta of the traded volume ,

Karputov and Cybert had some good indicators on the subject...

 
struct SPoint
{
    double mAsk;
    double mBid;
    double mLow;
    double mHigh;
    double mOpen;
    double mClose;
    double mPoint;
    double mSpread;
    double mVolume;
    datetime mTime;
};

struct SSymbol
{
    string mName;
    double mMean;
    double mUnit;
    double mOrder;
};

struct SSets
{
    SSymbol mSymbol;
    double mAsk[];
    double mBid[];
    double mLow[];
    double mHigh[];
    double mOpen[];
    double mClose[];
    double mPoint[];
    double mSpread[];
    double mVolume[];
    datetime mTime[];
};

struct SName
{
    string mData;
    SSets mSeries[];
};

int getCodes(int length)  // length - parameter that defines required sequence size
{
    SSets iSeries[];
    SName iCombinations[];

    int order = iSets.getPairs(iSeries, InpSymbols);  // split comma-separated string into array of structures iSeries
    int bars = iSets.getSourceSets(iSeries, PERIOD_CURRENT, order, InpDepth, InpShift);  // convert prices from array of structures MqlRates to iSeries

    if (bars < 1)
    {
        return 0;
    }

    int codes[];

    ArrayResize(codes, length);

    for (int k = 0; k < order; k++) // loop over all symbols in iSeries
    {
        ZeroMemory(codes);
        ArrayResize(iCombinations, k + 1);
        iCombinations[k].mData = iSeries[k].mSymbol.mName;
        
        double point = SymbolInfoDouble(iSeries[k].mSymbol.mName, SYMBOL_POINT);

        do
        {
            string comboChain = NULL;

            for (int i = length - 1; i >= 0; i--)
            {
                comboChain = IntegerToString(codes[i]) + comboChain;  // get combination from 000 to 111 on each iteration
            }

            for (int n = bars - 1; n >= length; n--)  // loop over prices for each symbol
            {
                double pips = 0;
                string comboSymbol = NULL;

                for (int i = 0; i < length; i++)  //  comparison of price sequence with generated sequence
                {
                    string symbolUnit = "X"; 
                    double range = iSeries[k].mClose[n - i] - iSeries[k].mOpen[n - i]; 

                    if (range > 0) 
                    {
                        symbolUnit = "1";
                        pips += range;
                    }

                    if (range < 0) 
                    {
                        symbolUnit = "0";
                        pips -= range;
                    }

                    comboSymbol = symbolUnit + comboSymbol;  // real prices define combination 
                }

                if (comboChain == comboSymbol) // compare generated sequence and real sequence
                {
                    int index = -1;
                    int count = ArraySize(iCombinations[k].mSeries);

                    for (int i = 0; i < count; i++)
                    {
                        if (iCombinations[k].mSeries[i].mSymbol.mName == comboChain)
                        {
                            index = i;
                            break;
                        }
                    }

                    if (index < 0)
                    {
                        ArrayResize(iCombinations[k].mSeries, count + 1);
                        ZeroMemory(iCombinations[k].mSeries[count]);
                        index = count;
                    }

                    // count matches, pips, etc

                    iCombinations[k].mSeries[index].mSymbol.mMean++;
                    iCombinations[k].mSeries[index].mSymbol.mOrder += iCombinations[k].mSeries[index].mSymbol.mMean + n;
                    iCombinations[k].mSeries[index].mSymbol.mUnit += MathAbs(pips / point);
                    iCombinations[k].mSeries[index].mSymbol.mName = comboChain;
                }
            }

        } while (iHelpers.getChain(codes, length)); // generate possible combinations from 000 to 111
    }

    string res = "\n";

    for (int k = 0; k < order; k++)
    {
        int count = ArraySize(iCombinations[k].mSeries);

        res += iCombinations[k].mData + "\n";

        for (int n = 0; n < count; n++)
        {
            res += 
                iCombinations[k].mSeries[n].mSymbol.mName + " : " + 
                DoubleToString(iCombinations[k].mSeries[n].mSymbol.mMean, 1) + " : " + 
                DoubleToString(iCombinations[k].mSeries[n].mSymbol.mOrder, 1) + " : " + 
                DoubleToString(iCombinations[k].mSeries[n].mSymbol.mUnit, 1) + "\n";
        }
    }

    iHelpers.debug(res); // print to a file

    return 1;
}
the code is cumbersome because the size of the series can be set in the parameters, as well as the set of all pairs, separated by commas
 

A good and fascinating idea.

At least it proves that the market does not lend itself to analysis via candlestick analysis.

The market is a response to the actions of real traders.

If there are 100 traders at a given moment - how many combinations of zeros and ones can there be?

 
Renat Akhtyamov: If there are 100 traders at a given time - how many combinations of zeros and ones can there be?
how is the number of traders related to the time-price chart?
 
Andy Sanders:
how is the number of trades related to the time-price chart?

The candlestick will form depending on - how many sold and how many bought.

That is, the sequence and shape of candlesticks is random. There are a huge number of combinations of candlestick sequences.

Trying to find and analyse patterns is utopia.

Here, for example.
 

Renat Akhtyamov:

.. The combinations of candlestick sequences are enormous.
The attempts to search for and analyze patterns are utopia.

Candlestick analysis (which is, after all, utopia) should not be confused with pattern calculation.

The candlestick itself is utopia - a crude representation of the nature of changes within a candlestick period.

And the pattern is built not on the candlesticks but on the sequence of quotes. The pattern is not connected with the bar opening time, it can be of random length, or it can be based on averaged data etc. Non-random patterns are almost the only possibility for "ordinary" traders, and the understanding of their essence is the minimum level of entrance to the "earners' club".

 
User_mt5:

Candlestick analysis (which is, after all, utopia) should not be confused with pattern calculation.

The candlestick itself is already utopia - a rough representation of the nature of changes within a candlestick period.

And the pattern is built not on the candlesticks but on the sequence of quotes. The pattern is not connected with the time of bar opening, it may be of random length, it may be built on the averaged data etc. Non-random patterns are almost the only possibility for "ordinary" traders, and the understanding of their essence is the minimum level of entrance to the "earners' club".

Wow. Alrighty.

Good luck!

PS:

Since everything is so cool, we should additionally define the proportional ratio of candlesticks, maximum and minimum of their sizes in order to find patterns.

So the code 0,1,1, will turn into something like this: 10,30,33

Each pattern must be run through history to set the profitable parameters.

Then create a pattern database

This is a great work that will probably bring a positive result.

 
Renat Akhtyamov:

Wow. Okey-dokey.

Good luck!

PS:

Since it's so cool, we need to further define the proportional ratio of candles, highs and lows and their sizes in order to find patterns.

So the code 0,1,1, will turn into something like this: 10,30,33

No. Not even cats can be born in two laps, three laps.

But in principle... In principle, you could do Morse code, but with a caveat: if you're not interested in the end result.

 
Renat Akhtyamov:

Each pattern must be run through the history to set the profitable parameters.

Then create a database of patterns

This is a huge work that will probably bring a positive result later.

It is possible to agree with this. Just in those terms - 'possibly' and 'subsequently'.

Even before that, you have to define this very 'every pattern'. And it is not profitable. The method is not about profit and trading in general. It's about repeating similar patterns. I.e. a pattern in the right side with their left side being similar. The length, shape, amplitude, cyclic frequency, and other parameters are all subject to research.

Yes. And if we do the same on the basis of candlesticks, we will have the same result, but it will be weaker and more awkward. And there are fewer patterns - simply by the definition of a candlestick.

Reason: