Hi every one
i want to make table that shows trade time in a week for symbols. like the pic below.
how should i use SymbolInfoSessionTrade to create it?
is it possible?
is it possible?
I don't think anyone understands how to help you. As the answer is right below the link in your first post
may you help me why this is not working?
#property version "1.00" #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- //Comment("Current = ",TimeCurrent(),"\r\n", // "GMT = ",TimeGMT(),"\r\n", // "Local = ",TimeLocal(),"\r\n", // "TraeServer = ",TimeTradeServer(),"\r\n" // ) datetime d1,d2; SymbolInfoSessionTrade(Symbol(),SUNDAY,0,d1,d2); string s = TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),MONDAY,0,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,0,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),WEDNESDAY,0,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,0,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),FRIDAY,0,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n\r\n"; SymbolInfoSessionTrade(Symbol(),SUNDAY,1,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),MONDAY,1,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,1,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),WEDNESDAY,1,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,1,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),FRIDAY,1,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n\r\n"; SymbolInfoSessionTrade(Symbol(),SUNDAY,2,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),MONDAY,2,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,2,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),WEDNESDAY,2,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,2,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),FRIDAY,2,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n\r\n"; SymbolInfoSessionTrade(Symbol(),SUNDAY,3,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),MONDAY,3,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,3,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),WEDNESDAY,3,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),TUESDAY,3,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n"; SymbolInfoSessionTrade(Symbol(),FRIDAY,3,d1,d2); s += TimeToString(d1,TIME_DATE|TIME_MINUTES)+" "+TimeToString(d2,TIME_DATE|TIME_MINUTES)+"\r\n\r\n"; Comment(s); return(rates_total); }
may you help me why this is not working?
.
yes i red it all but i didnt get the point.
//--- set datetime variables
datetime de, a;
//--- get open and close session
SymbolInfoSessionTrade(_Symbol,FRIDAY,0,de,a);
//--- set MqlDateTime variables
MqlDateTime sec_aper, sec_cier;
//--- convert datetime variables to MqlDateTime variables
TimeToStruct(de,sec_aper);
//--- check if this works for you
Comment("Open: ", sec_aper.hour, ":", sec_aper.min, "; Close: ", sec_cier.hour, ":", sec_cier.min);
//--- set datetime variables
datetime de, a;
//--- get open and close session
SymbolInfoSessionTrade(_Symbol,FRIDAY,0,de,a);
//--- set MqlDateTime variables
MqlDateTime sec_aper, sec_cier;
//--- convert datetime variables to MqlDateTime variables
TimeToStruct(de,sec_aper);
//--- check if this works for you
Comment("Open: ", sec_aper.hour, ":", sec_aper.min, "; Close: ", sec_cier.hour, ":", sec_cier.min);
Thank You!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi every one
i want to make table that shows trade time in a week for symbols. like the pic below.
how should i use SymbolInfoSessionTrade to create it?