//+------------------------------------------------------------------+
//| Value per pips.mq4 |
//| Copyright © 2011, Aiman |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, Aiman"
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
double totalLots=0;
double pipsValue=0;
double remPips=0;
for (int i=0; i<OrdersTotal(); i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_BUY) totalLots+=OrderLots();
if (OrderType()==OP_SELL) totalLots-=OrderLots();
}
if (totalLots!=0)
{
pipsValue = MathAbs(totalLots)/MarketInfo(Symbol(),MODE_TICKVALUE);
remPips = ((AccountFreeMargin()/pipsValue)*AccountStopoutLevel()/100)-(AccountFreeMargin()/pipsValue);
}
MessageBox("Value per 1 lots: $" + DoubleToStr(MarketInfo(Symbol(),MODE_TICKVALUE),2) +
"\n\nAbsolute Active Lots: " + DoubleToStr(MathAbs(totalLots),2) +
"\nValue per pips: $" + DoubleToStr(pipsValue,2) +
"\n\nFree Margin: $:" + DoubleToStr(AccountFreeMargin(),2) +
"\nStop Out Level: "+DoubleToStr(AccountStopoutLevel(),2)+"%" +
"\n\nPips to Margin Call: " + DoubleToStr(remPips,0)
, Symbol());
//----
return(0);
}
//+------------------------------------------------------------------+