//+------------------------------------------------------------------+ //| //| | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, AKA TradeForexFX" #property link "http://www./" string Expert_Name = "MyManager"; //*********************** //extern string EA_Comment = "MyManager"; extern double LotSize = 0.01; extern int MinPipsMargin = 80; extern bool ShowComments = true; extern bool UniversalLotSize = true; int init() { GlobalVariableSet("PipMargin", MinPipsMargin) ; GlobalVariableSet("Size", LotSize) ; return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { if (ShowComments ) ShowCommentsMode(); return(0); } void ShowCommentsMode() { double Lots, MyMargin ; double Total =0; for (int i = OrdersTotal(); i >= 0; i --) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); Total = Total + OrderLots(); } if(UniversalLotSize) Lots = GlobalVariableGet("Size"); /// Must use global variable name in quotes if(UniversalLotSize) MyMargin = GlobalVariableGet("PipMargin"); Comment ( "", "\n", "Total Orders in trade " , Total,"\n", "My Margin " , " ",MyMargin,"\n", "Lots " , " ",Lots ); }