Add News filter and time filter

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Add News filter and time filter

Postby bored12345 » Mon Jan 15, 2024 1:39 am

Good day Apprentice,

I would like to ask if you can include the following below to the attached ea.

News Filter
Time filter with time for each day
Maximum Drawdown % for a day
Maximum Profit for a day

Thanks a lot.
Attachments
EA Scalp.mq4
(58.13 KiB) Downloaded 47 times
bored12345
 
Posts: 1
Joined: Mon Jan 15, 2024 1:08 am

Re: Add News filter and time filter

Postby Apprentice » Sat Jan 20, 2024 4:45 am

We have added your request to the development list.
Development reference 90
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36495
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: Add News filter and time filter

Postby rickCreations » Sun Mar 03, 2024 8:29 am

Code: Select all
//-----------------------------------------------------------------------------------------------

void ReadFileHst(string FileName)
{
    int j = 0;
    ;
    string strFileContents;
    int    Handle;
    int    LogFileSize;
    int    movehigh[1] = {0};
    uchar  buffer[];
    int    nNumberOfBytesToRead;
    int    read[1] = {0};
    int    i;
    double mm;
    //----- -----
    strFileContents = "";
    Handle          = CreateFileW(FileName, (int)0x80000000, 3, 0, 3, 0, 0);
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    if (Handle == -1) {
        Comment("");
        return;
    }
    LogFileSize = GetFileSize(Handle, 0);
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    if (LogFileSize <= 0) {
        return;
    }
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    if ((LogFileSize - 148) / 60 == BytesToRead) {
        return;
    }
    SetFilePointer(Handle, 148, movehigh, 0);
    BytesToRead = (LogFileSize - 148) / 60;
    ArrayResize(data, BytesToRead, 0);
    nNumberOfBytesToRead = 60;
    ArrayResize(buffer, 60, 0);
    for (i = 0; i < BytesToRead; i = i + 1)
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    {
        ReadFile(Handle, buffer, nNumberOfBytesToRead, read, NULL);
        if (read[0] == nNumberOfBytesToRead) {
            result = StringFormat("0x%02x%02x%02x%02x%02x%02x%02x%02x", buffer[7], buffer[6], buffer[5], buffer[4], buffer[3], buffer[2], buffer[1], buffer[0]);

            m_price.buffer[0] = buffer[32];
            m_price.buffer[1] = buffer[33];
            m_price.buffer[2] = buffer[34];
            m_price.buffer[3] = buffer[35];
            m_price.buffer[4] = buffer[36];
            m_price.buffer[5] = buffer[37];
            m_price.buffer[6] = buffer[38];
            m_price.buffer[7] = buffer[39];
            mm                = m_price.close;
            data[j][0]        = StringToDouble(result);
            data[j][1]        = mm;
            j                 = j + 1;
            strFileContents   = TimeToString(StringToTime(result), 3) + " " + DoubleToString(mm, 8);
        } else {
            CloseHandle(Handle);
            return;
        }
    }
    CloseHandle(Handle);
    strFileContents = DoubleToString(data[j - 1][0], 3) + " " + DoubleToString(data[j - 1][1], 8) + " " + DoubleToString(data[j - 2][1], 3) + " " + DoubleToString(data[j - 2][1], 8);
    result          = strFileContents;
}
// ReadFileHst <<==--------   --------
int fnGetLotDigit()
{
    double l_LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
    if (l_LotStep == 1)
        return (0);
    if (l_LotStep == 0.1)
        return (1);
    if (l_LotStep == 0.01)
        return (2);
    if (l_LotStep == 0.001)
        return (3);
    if (l_LotStep == 0.0001)
        return (4);
    return (1);
}
//+------------------------------------------------------------------+





This file has history Reading inside of it, this project should have never been accepted since all backtest data is 100% false from what it will really trade.
rickCreations
 
Posts: 38
Joined: Sat May 06, 2023 9:35 am


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot] and 39 guests