Как разделить историю на различные символы в MQL4
- www.mql5.com
- Как сделать советник что бы сразу покупал или продавал MQL4
- Загрузка собственной истории, как создать собственный символ ?
- Несколько советников в одном.
Плиз помогите найти скрипт или советник что ни будь как вообще можно разделить историю сделок на части что бы не искать отдельно нужный инструмент :) ну то есть типо доллар/евро отдельно от ены/доллар и т.д. а не все в куче :) Я очень буду благодарен если поможете мне в этом Вопросе !! Спасибо Всем кто поможет :)
- www.mql5.com
Плиз помогите найти скрипт или советник что ни будь как вообще можно разделить историю сделок на части что бы не искать отдельно нужный инструмент :) ну то есть типо доллар/евро отдельно от ены/доллар и т.д. а не все в куче :) Я очень буду благодарен если поможете мне в этом Вопросе !! Спасибо Всем кто поможет :)
Вот уже разделили
здесь получше - MQL4 Function pointer / function callback solution
// Orchard Function Pointer
добавьте в input Ticker и по Price я особо не вчитывалась - но вам это и не надо -- изучите код / адаптируйте
//+------------------------------------------------------------------+ //| TK_Profit.mq4 | // https://www.youtube.com/watch?v=XUrEhoOuD9o // MQL4 Function pointer / function callback solution // Orchard - Function Pointer //+------------------------------------------------------------------+ #property copyright "OrchardForex" #property link "https://www.youtube.com/watch?v=XUrEhoOuD9o " #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ #property show_inputs struct SOrderTotalSimple { int count; double profit; double lots; datetime firstOpenTime; datetime lastOpenTime; double highOpenPrice; double lowOpenPrice; }; struct SOrderTotal : SOrderTotalSimple { int orderTicketList[]; }; // function definitions // Condition function - 4 functions typedef double(*TOrderValue)(); double FOpenTime() {return ((double) OrderOpenTime());} double FCloseTime() {return ((double) OrderCloseTime());} double FLots() {return(OrderLots());} double FProfit() {return(OrderProfit());} // Alternate condition functio typedef bool(*TOrderSelect)(double, double); // Summation Function //*TOrderTotal - fx-ptr returns void but accepts SOrderTotal& typedef void(*TOrderTotal)(SOrderTotal&); // inputs - datetime InpStartTime = 0; // Start date & time datetime InpEndTime = 0; // End date and time input string mySymbol ="EURUSD"; void OnStart() { SOrderTotal orderTotal; // In case of zero end time datetime endTime = InpEndTime==0 ? TimeCurrent() : InpEndTime; string msg = ""; // Load the history data SumOrders1(mySymbol, -1, -1, InpStartTime, endTime, FCloseTime, MODE_HISTORY, FOrderTotal, orderTotal); msg = StringFormat("For history count=%i, profit=%.2f, lots=%.2f" + ", firstTime=%s, lastTime=%s" + ", lowPrice=%.2f, highPrice=%.2f", orderTotal.count, orderTotal.profit, orderTotal.lots, TimeToString(orderTotal.firstOpenTime), TimeToString(orderTotal.lastOpenTime), orderTotal.lowOpenPrice, orderTotal.highOpenPrice); MessageBox(msg, "History", MB_OK); msg = "Here are the tickets: "; for (int i=0; i< orderTotal.count; i++) { msg += IntegerToString(orderTotal.orderTicketList[i]) + ", "; } MessageBox(msg, "History Tickets", MB_OK); } //+------------------------------------------------------------------+ void SumOrders1(string symbol, int magic, int orderType, double limitLow, double limitHigh, TOrderValue fValue, /*fx from current Order*/ int mode, TOrderTotal fOrderTotal, SOrderTotal &total, bool reset=true){ if (reset) { SOrderTotalSimple tmp = {0.0}; total = tmp; } int cnt = mode == MODE_HISTORY ? OrdersHistoryTotal() : OrdersTotal(); double orderValue; // to return from fValue // Make enough room in the array ArrayResize(total.orderTicketList, total.count+cnt); for (int i=0; i<cnt; i++) { if (OrderSelect(i, SELECT_BY_POS, mode)) { if ((symbol=="" || OrderSymbol()==symbol) && (magic<0 || OrderMagicNumber()==magic) && (orderType<0 || OrderType()==orderType) && OrderType()!=ORDER_TYPE_BALANCE){ orderValue = fValue(); if (orderValue >= limitLow && orderValue <=limitHigh) { fOrderTotal(total); } } } } // In case the array is too big due to filters ArrayResize(total.orderTicketList, total.count); return; } void FOrderTotal(SOrderTotal &total) { // Simple accumulators total.count++; total.profit += OrderProfit(); total.lots += OrderLots(); // Arrays total.orderTicketList[total.count-1] = OrderTicket(); // Limit accumulators if (OrderOpenTime()<total.firstOpenTime || total.firstOpenTime==0) { total.firstOpenTime=OrderOpenTime(); } if (OrderOpenTime()>total.lastOpenTime ) { total.lastOpenTime = OrderOpenTime(); } if (OrderOpenPrice()<total.lowOpenPrice || total.lowOpenPrice ==0) { total.lowOpenPrice = OrderOpenPrice(); } if (OrderOpenPrice()>total.highOpenPrice ) { total.highOpenPrice = OrderOpenPrice(); } }
Плиз помогите найти скрипт или советник что ни будь как вообще можно разделить историю сделок на части что бы не искать отдельно нужный инструмент
в самом MT: Терминал (Ctrl+T)->История счёта-> в шапке нажмите поле Символ ==> получите сортировку по этому полю (в отсортированном списке удобнее будет глазам)... даже без скрипта