add timer to current time mql5

 





datetime AddMinutesToTime(datetime currentTime, int minutesToAdd) {

    // Convert the current time to a structure

    MqlDateTime dt;

    TimeToStruct(currentTime, dt);


    // Add the specified minutes

    dt.min += minutesToAdd;

    if (dt.min >= 60) {

        dt.hour += dt.min / 60;

        dt.min %= 60;

    }


    // Convert the modified structure back to time

    return StructToTime(dt);

}


Comments

Popular posts from this blog

MQL5 : Add time to current time in mins

MQL5: Closed order detail