Hello dear coders,
I've been a long time desperately looking for a simple indicator that shows me how much money I need to spend per lot (mini-lot) . Below is a code where this feature is located amongst others, but I only need the bolded-one.
Or is there perhaps an easy indicator for this info?
Like this one ...but not for free.
checkMargin.ex4 is to tell you that how much initial margin requirement [ or used margin] per amount of lot sizes you wish to open positions.
Perhaps it is enough to simplify the formula, but actually it should be more an indicator that reflects the price needed per lot instead of the free margin.
So what it cost for a lot or mini lot per currency pair.?
Can any of you help me please?
Thanks very much.
Gilbert (Belgium)
//+------------------------------------------------------------------+
//| BinuJoshep.mq4 |
//| Copyright 2007, syanwar (Viking Automatic Trading Services | Custom Expert Advisor Development | Expert Advisor Programming, Automatic Trading, MQL Programming, Expert Advisor, Robot Trading, syanwar, forex) |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright 2007, syanwar (www.viking234.com)"
#property link "[email protected]"
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
Comment("");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//---- indicators
double MPoint = MarketInfo(Symbol(), MODE_POINT); // Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point
double MTickva = MarketInfo(Symbol(), MODE_TICKVALUE); // Tick value in the deposit currency.
double MTicksa = MarketInfo(Symbol(), MODE_TICKSIZE); // Tick size in points.
double MSpread = MarketInfo(Symbol(), MODE_SPREAD); // Spread value in points.
double MMinlot = MarketInfo(Symbol(), MODE_MINLOT); // Minimum permitted amount of a lot.
double MMaxlot = MarketInfo(Symbol(), MODE_MAXLOT); // Maximum permitted amount of a lot.
double MLotste = MarketInfo(Symbol(), MODE_LOTSTEP); // Step for changing lots.
double MStopLe = MarketInfo(Symbol(), MODE_STOPLEVEL); // Stop level in points.
double MLotsiz = MarketInfo(Symbol(), MODE_LOTSIZE); // Lot size in the base currency.
double MSwapty = MarketInfo(Symbol(), MODE_SWAPTYPE); // Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
double MSwaplo = MarketInfo(Symbol(), MODE_SWAPLONG); // Swap of the long position.
double MSwapsh = MarketInfo(Symbol(), MODE_SWAPSHORT); // Swap of the short position.
double MStrati = MarketInfo(Symbol(), MODE_STARTING); // Market starting date (usually used for futures).
double MExpira = MarketInfo(Symbol(), MODE_EXPIRATION); // Market expiration date (usually used for futures).
double MTradea = MarketInfo(Symbol(), MODE_TRADEALLOWED); // Trade is allowed for the symbol.
double MProcal = MarketInfo(Symbol(), MODE_PROFITCALCMODE); // Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.
double MDigits = MarketInfo(Symbol(), MODE_DIGITS); // Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits
double MMarcal = MarketInfo(Symbol(), MODE_MARGINCALCMODE); // Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
double MMarini = MarketInfo(Symbol(), MODE_MARGININIT); // Initial margin requirements for 1 lot.
double MMarman = MarketInfo(Symbol(), MODE_MARGINMAINTENANCE); // Margin to maintain open positions calculated for 1 lot.
double MMarhed = MarketInfo(Symbol(), MODE_MARGINHEDGED); // Hedged margin calculated for 1 lot.
double MMarreq = MarketInfo(Symbol(), MODE_MARGINREQUIRED); // Free margin required to open 1 lot for buying.
double MFreezl = MarketInfo(Symbol(), MODE_FREEZELEVEL); // Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.
//----
Comment(
"ACCOUNT INFOn- AccountLeverage: "+AccountLeverage()+
"n- AccountNumber: "+AccountNumber()+
"n- AccountName: "+AccountName()+
"n- AccountCompany: "+AccountCompany()+
"n- AccountServer: "+AccountServer()+
"nMARKET INFOn-= ", MPoint,
" (Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point)n-= ", MTickva,
" (Tick value in the deposit currency)n-= ", MTicksa,
" (Tick size in points)n-= ", MSpread,
" (Spread value in points)n-= ", MMinlot,
" (Minimum permitted amount of a lot)n-= ", MMaxlot,
" (Maximum permitted amount of a lot)n-= ", MLotste,
" (Step for changing lots)n-= ", MStopLe,
" (Stop level in points)n-= ", MLotsiz,
" (Lot size in the base currency)n-= ", MSwapty,
" (Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency)n-= ", MSwaplo,
" (Swap of the long position)n-= ", MSwapsh,
" (Swap of the short position)n-= ", MStrati,
" (Market starting date (usually used for futures))n-= ", MExpira,
" (Market expiration date (usually used for futures))n-= ", MTradea,
" (Trade is allowed for the symbol)n-= ", MProcal,
" (Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures)n-= ", MDigits,
" (Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits)n-= ", MMarcal,
" (Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices)n-= ", MMarini,
" (Initial margin requirements for 1 lot)n-= ", MMarman,
" (Margin to maintain open positions calculated for 1 lot)n-= ", MMarhed,
" (Hedged margin calculated for 1 lot)n-= ", MMarreq,
" (Free margin required to open 1 lot for buying)n-= ", MFreezl,
" (Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed)");//----
//----
return(0);
}
//+------------------------------------------------------------------+
I've been a long time desperately looking for a simple indicator that shows me how much money I need to spend per lot (mini-lot) . Below is a code where this feature is located amongst others, but I only need the bolded-one.
Or is there perhaps an easy indicator for this info?
Like this one ...but not for free.
checkMargin.ex4 is to tell you that how much initial margin requirement [ or used margin] per amount of lot sizes you wish to open positions.
Perhaps it is enough to simplify the formula, but actually it should be more an indicator that reflects the price needed per lot instead of the free margin.
So what it cost for a lot or mini lot per currency pair.?
Can any of you help me please?
Thanks very much.
Gilbert (Belgium)
//+------------------------------------------------------------------+
//| BinuJoshep.mq4 |
//| Copyright 2007, syanwar (Viking Automatic Trading Services | Custom Expert Advisor Development | Expert Advisor Programming, Automatic Trading, MQL Programming, Expert Advisor, Robot Trading, syanwar, forex) |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright 2007, syanwar (www.viking234.com)"
#property link "[email protected]"
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
Comment("");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//---- indicators
double MPoint = MarketInfo(Symbol(), MODE_POINT); // Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point
double MTickva = MarketInfo(Symbol(), MODE_TICKVALUE); // Tick value in the deposit currency.
double MTicksa = MarketInfo(Symbol(), MODE_TICKSIZE); // Tick size in points.
double MSpread = MarketInfo(Symbol(), MODE_SPREAD); // Spread value in points.
double MMinlot = MarketInfo(Symbol(), MODE_MINLOT); // Minimum permitted amount of a lot.
double MMaxlot = MarketInfo(Symbol(), MODE_MAXLOT); // Maximum permitted amount of a lot.
double MLotste = MarketInfo(Symbol(), MODE_LOTSTEP); // Step for changing lots.
double MStopLe = MarketInfo(Symbol(), MODE_STOPLEVEL); // Stop level in points.
double MLotsiz = MarketInfo(Symbol(), MODE_LOTSIZE); // Lot size in the base currency.
double MSwapty = MarketInfo(Symbol(), MODE_SWAPTYPE); // Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency.
double MSwaplo = MarketInfo(Symbol(), MODE_SWAPLONG); // Swap of the long position.
double MSwapsh = MarketInfo(Symbol(), MODE_SWAPSHORT); // Swap of the short position.
double MStrati = MarketInfo(Symbol(), MODE_STARTING); // Market starting date (usually used for futures).
double MExpira = MarketInfo(Symbol(), MODE_EXPIRATION); // Market expiration date (usually used for futures).
double MTradea = MarketInfo(Symbol(), MODE_TRADEALLOWED); // Trade is allowed for the symbol.
double MProcal = MarketInfo(Symbol(), MODE_PROFITCALCMODE); // Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures.
double MDigits = MarketInfo(Symbol(), MODE_DIGITS); // Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits
double MMarcal = MarketInfo(Symbol(), MODE_MARGINCALCMODE); // Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices.
double MMarini = MarketInfo(Symbol(), MODE_MARGININIT); // Initial margin requirements for 1 lot.
double MMarman = MarketInfo(Symbol(), MODE_MARGINMAINTENANCE); // Margin to maintain open positions calculated for 1 lot.
double MMarhed = MarketInfo(Symbol(), MODE_MARGINHEDGED); // Hedged margin calculated for 1 lot.
double MMarreq = MarketInfo(Symbol(), MODE_MARGINREQUIRED); // Free margin required to open 1 lot for buying.
double MFreezl = MarketInfo(Symbol(), MODE_FREEZELEVEL); // Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed.
//----
Comment(
"ACCOUNT INFOn- AccountLeverage: "+AccountLeverage()+
"n- AccountNumber: "+AccountNumber()+
"n- AccountName: "+AccountName()+
"n- AccountCompany: "+AccountCompany()+
"n- AccountServer: "+AccountServer()+
"nMARKET INFOn-= ", MPoint,
" (Point size in the quote currency. For the current symbol, it is stored in the predefined variable Point)n-= ", MTickva,
" (Tick value in the deposit currency)n-= ", MTicksa,
" (Tick size in points)n-= ", MSpread,
" (Spread value in points)n-= ", MMinlot,
" (Minimum permitted amount of a lot)n-= ", MMaxlot,
" (Maximum permitted amount of a lot)n-= ", MLotste,
" (Step for changing lots)n-= ", MStopLe,
" (Stop level in points)n-= ", MLotsiz,
" (Lot size in the base currency)n-= ", MSwapty,
" (Swap calculation method. 0 - in points; 1 - in the symbol base currency; 2 - by interest; 3 - in the margin currency)n-= ", MSwaplo,
" (Swap of the long position)n-= ", MSwapsh,
" (Swap of the short position)n-= ", MStrati,
" (Market starting date (usually used for futures))n-= ", MExpira,
" (Market expiration date (usually used for futures))n-= ", MTradea,
" (Trade is allowed for the symbol)n-= ", MProcal,
" (Profit calculation mode. 0 - Forex; 1 - CFD; 2 - Futures)n-= ", MDigits,
" (Count of digits after decimal point in the symbol prices. For the current symbol, it is stored in the predefined variable Digits)n-= ", MMarcal,
" (Margin calculation mode. 0 - Forex; 1 - CFD; 2 - Futures; 3 - CFD for indices)n-= ", MMarini,
" (Initial margin requirements for 1 lot)n-= ", MMarman,
" (Margin to maintain open positions calculated for 1 lot)n-= ", MMarhed,
" (Hedged margin calculated for 1 lot)n-= ", MMarreq,
" (Free margin required to open 1 lot for buying)n-= ", MFreezl,
" (Order freeze level in points. If the execution price lies within the range defined by the freeze level, the order cannot be modified, cancelled or closed)");//----
//----
return(0);
}
//+------------------------------------------------------------------+