This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double DailyProfit() | |
{ | |
double profit = 0; | |
int i, hstTotal = OrdersHistoryTotal(); | |
for (i = 0; i < hstTotal; i++) | |
{ | |
if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) == TRUE) | |
{ | |
if (OrderType() > 1) | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void DeletePendingOrders() | |
{ | |
if (OrdersTotal() >= 1) | |
{ | |
if (OrderSelect(0, SELECT_BY_POS, MODE_TRADES)) | |
{ | |
if (OrderType() == OP_BUYLIMIT || OrderType() == OP_SELLLIMIT) | |
{ | |
if ((((TimeHour(OrderOpenTime())*60)+TimeMinute(OrderOpenTime())) - ((Hour()*60)+Minute()))>5) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string MyLastOrderType() | |
{ | |
// retrieving info from trade history | |
string LastOrderType = "None"; | |
int i, hstTotal = OrdersHistoryTotal(); | |
for (i = 0; i < hstTotal; i++) | |
{ | |
//---- check selection result | |
OrderSelect(i, SELECT_BY_POS, MODE_HISTORY); | |
if (i == OrdersHistoryTotal() - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double MylastOrderProfit() | |
{ | |
// retrieving info from trade history | |
double LastOrderProfit = 0; | |
int i, hstTotal = OrdersHistoryTotal(); | |
for (i = 0; i < hstTotal; i++) | |
{ | |
//---- check selection result | |
OrderSelect(i, SELECT_BY_POS, MODE_HISTORY); | |
if (i == OrdersHistoryTotal() - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double MylastOrderOpenPrice() | |
{ | |
// retrieving info from trade history | |
double LastOrderOpenPrice = 0; | |
int i, hstTotal = OrdersHistoryTotal(); | |
for (i = 0; i < hstTotal; i++) | |
{ | |
//---- check selection result | |
OrderSelect(i, SELECT_BY_POS, MODE_HISTORY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import pandas as pd | |
import MetaTrader5 as mt5 | |
import re | |
mt5.initialize() | |
account=###Your Acount###### | |
authorized= mt5.login(account) | |
first_date = datetime.datetime(1970, 1, 1) |