#include "BaseScalper.mqh" struct SPivotPoint { double price; MqlDateTime time; }; class CM1PivotLevels : public CBaseScalper { protected: SPivotPoint m_pointMin; SPivotPoint m_pointMax; int m_hour; int m_minite; double ask0, ask1; void CalcPivotPoints() { SPivotPoint p0, p1, pnow; datetime dt = TimeCurrent(), dt0, dt1; TimeToStruct(dt, pnow.time); if(pnow.time.day_of_week >=2 && pnow.time.day_of_week <=5) //from Tuesday to Friday { return; } if(pnow.time.day_of_week ==1) //now is Monday { dt0 = dt - 24*3600*4;//got the last Tuesday the same time dt1 = dt - 24*3600*3;//got the last Friday the same time TimeToStruct(dt0, p0.time); TimeToStruct(dt1, p1.time); p0.time.hour = PivotHour; p0.time.min = PivotMinute; p1.time.hour = PivotHour; p1.time.min = PivotMinute; dt0 = StructToTime(p0.time); //got the right time of Pivot point dt1 = StructToTime(p1.time); //got the right time of Pivot point } } public: CM1PivotLevels() {} CM1PivotLevels(int magic) : CBaseScalper(magic) { } CM1PivotLevels(int magic, string symbol) : CBaseScalper(magic, symbol) { Print("test"); } void SetPivotTime(int hour, int minite) { } void GetPivotLines(double lmin, double lmax) { } };