Script to list the drawdowns of open positions

MQL5 Script

Lavoro terminato

Tempo di esecuzione 2 giorni

Specifiche

Summary

This function will extract a snapshot of the data needed to identify the drawdown of individual EA’s.

 

The idea is to use the standard Metatrader toolbox trade data to obtain a snapshot of the open profit or loss for each open position along with the magic number associated with the position.

 

Building up a series of these over time will give an idea of the drawdown experienced by individual EA’s.

 

The function will create a regularly produced CSV files and place them in the existing MLQ5 Shared Projects folder.

Requirements

 

Changing the frequency of how often the extract is run

 

The frequency of the intervals for creating the file should be a parameter that can be altered. 

 

Initially, this may be five minutes but could change.  A user interface is not required on the assumption that it will be pretty easy to edit that item in whatever code is provided. Just show me where it is located in the code.

 

Timing of when the extract run

The extract should run at regular intervals based on a parameter that I can access e.g. 5 minutes.

The standard time periods for Metatrader should be possible; M1, M5, M15, H1, H4, D1

 

Using five minuets, say, each run should start on the next exact five minute mark, the opening of the next M5 candle. If the run is set up at 13.06 then the next extract should be at 13.10.

 

M15 should start at the next quarter hour. If the run is set up at 13.06 then the next extract should be at the beginning of the next M15 candle - 13.15.

 

H1 should start on the next hour.  If the run is set up at 13.06 then the next extract should be at the beginning of the next H1 candle - 14.00.

 

H4 should start at the beginning of the next H4 candle etc.

 

 

File Name

Each file created should have a unique file name made up of Metatrader logon (Account number of the account, Date (format yyyymmdd), Broker time that the extract was performed (24 hour format hhmm)

 

An example of a file name

50796986

Account number

20230309

Date

1605

Broker time

 

 

 

The filename would look like this:

50796986202303091605

 

 

 

 


 

File content

File to contain values under the column headings from the trade tab of the toolbox.  The required columns are listed below and See example at the end of this section.

 

Note that there are two additional columns required:

A column should be added with the time of the file creation (Timestamp).  This column allows a time based analysis of the individual open positions.

 

A column should be added for the terminal login (not the hashed number created by MT5 for the data folder)

 

I will be combining different files from different accounts, so I need to know where the transactions originated!

 

File columns

Symbol

ticket

time[Entry]

type

volume

price[entry]

SL

TP

Price [at the time of the extract]

Value

Swap,

Profit

Magic

Comment

Terminal Login

Timestamp of report

 

The order of the columns or rows is not important if an existing function provides it in a different sequence.

 

e.g. Copied from a trade terminal but with the new time created column added. (see zip file attached)


 

 

File location

Write each file to an standard Metatrader folder for the terminal: MLQ5/shared projects. Using the naming requirement will mean that every file has a unique name.

 

 

Conclusion

Let me know what else you need or if you think there is a different way to do this.

 

 

Ian Fraser


Con risposta

1
Sviluppatore 1
Valutazioni
(158)
Progetti
175
43%
Arbitraggio
6
0% / 67%
In ritardo
8
5%
Gratuito
2
Sviluppatore 2
Valutazioni
(133)
Progetti
174
18%
Arbitraggio
17
47% / 18%
In ritardo
0
Gratuito
3
Sviluppatore 3
Valutazioni
(8)
Progetti
9
22%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
I’m looking for someone experienced with Think or Swim to create a backtesting script for an in-the-money Iron Condor strategy using options on the SPX. The strategy involves setting up 10 contracts of an Iron Condor with a 10-point spread width and a net credit requirement of $11 per contract. The goal is to backtest the performance over the last three years, focusing on trades where the SPX closes outside a
I currently have a license code that connects to my web server, and I add the account number, client name, and expiration date. I’d like something more automated. Currently I allow clients 10 licenses, but adding for them on my side can get exhausting. I’d like a better solution for myself and clients

Informazioni sul progetto

Budget
30+ USD
IVA (23%): 6.9 USD
Totale: 36.9 USD
Per lo sviluppatore
27 USD