Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Bibliothèque

LastOrder - bibliothèque pour MetaTrader 4

Vues:
11642
Note:
(36)
Publié:
2014.09.09 08:32
Mise à jour:
2017.03.30 13:11
LastOrder.mqh (12.41 KB) afficher
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

The header file contains functions for searching last and previous order in the trade pool.

The functions list:

Function
Short description of the function
int get_last_order( int magic, int type = -1, int mode = MODE_TRADES ) get_last_order() returns ticket number of the last order. The function returns -1 value when it havent found last order.
 Arguments: magic - Magic Number ID filtering orders. When 0  it is not used.                                              
 type - type order (buy, sell, sell limit, buy limit, sell stop, buy stop) for filtering orders.
 mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders. 
int get_first_order( int magic, int type = -1, int mode = MODE_TRADES )
get_first_order() returns ticket number of the first order. The function returns -1 value when it havent found first order.
 Arguments: magic - Magic Number ID filtering orders. When 0  it is not used.                                              
 type - type order (buy, sell, sell limit, buy limit, sell stop, buy stop) for filtering orders.
 mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
double order_lots( int ticket, int mode = MODE_TRADES )
order_lots() returns trade volume by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
string order_comment( int ticket, int mode = MODE_TRADES )
order_comment() returns string comment of the order by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
int order_type( int ticket, int mode = MODE_TRADES )
order_type() returns type of the order by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
double order_open_price( int ticket, int mode = MODE_TRADES )
order_open_price() returns open price of the order by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
double order_close_price( int ticket, int mode = MODE_TRADES )order_close_price() returns close price of the order by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
datetime order_open_time( int ticket, int mode = MODE_TRADES )order_open_time() returns open time of the order by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
datetime order_close_time( int ticket, int mode = MODE_TRADES )
order_close_time() returns close time of the order by ticket number.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
int close_by( int ticket, int mode = MODE_TRADES )close_by() returns the trigger of closing the order:by takeprofit (1), by stoploss (-1), manual(0).It is defined based on comment of the order.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
int close_by2( int ticket, int mode = MODE_TRADES )close_by2() returns the trigger of closing the order:by takeprofit (1), by stoploss (-1), manual(0). It is defined based on the close price and open price of the order.
Arguments: ticket - ticket number of the order.
mode - pool of orders: MODE-TRADES - trade orders, MODE_HISTORY - closed orders.
int orders_count( int magic, int type = -1, string comment = "" )
orders_count() returns the count of the opened orders.
Arguments: magic - Magic Number ID filtering orders. When 0 it is not used.
type - orders type (buy, sell, sell limit, buy limit, sell stop, buy stop) for filtering orders. When -1 is not used.
comment - comment string of the orders. When "" (empty) is not used.

Traduit du russe par MetaQuotes Ltd.
Code original : https://www.mql5.com/ru/code/11816

COrdersCounter COrdersCounter

The simple class for counting of the orders with different filters: by symbol of currency, Magic Number, either closed, either opened orders.

RobotiADXwining RobotiADXwining

Expert Advisor work with one hour chart, and is the best robot for now, plays a sound when orders/alarms are executed and multiply positions by 10 when 5 digits is true, trailing stops every tick regardless of Execution Mode.

MTF Inside Bar MTF Inside Bar

A tool to better visualize price action using a higher timeframe.

NetFlows NetFlows

The indicator computes the volume-adjusted flow of a currency considering all currency pairs available on your platform.