swap_or_cost_point

Download script
Author: Copyright � 2005, Mindaugas, �����. ��
swap_or_cost_point

This script is designed as a practical calculation tool for traders who need to quickly determine the financial implications of different currency pairs based on a specific trade size. Its primary purpose is to translate abstract market data into tangible cost figures, helping you visualize how much a move in price actually affects your capital.

How it Works

The logic operates by taking a fixed base "lot" size (the amount of currency you are trading) and applying it across a wide variety of major and minor currency pairs.

  1. Dynamic Conversion: Rather than just showing a static number, the script looks at current market prices to calculate the specific volume for various pairs (such as EURUSD, USDJPY, GBPCHF, etc.). This ensures that the values displayed are relevant to the current state of the market.
  2. Customizable Cost Multipliers: The tool uses pre-defined coefficients for different currencies. These represent the "cost" or "weight" associated with each pair. By multiplying the trade volume by these specific constants, the script provides a customized view of profit or loss potential.
  3. Toggleable Information Display: The logic includes a simple switch that allows you to choose between two types of information:
    • Detailed View (Active): When enabled, the tool displays the calculated trade volume for each currency pair alongside two distinct cost/swap values. This is useful for understanding the "hidden" costs or weighted impacts of holding specific positions.
    • Simplified View: When disabled, the tool strips away the extra coefficients and simply lists the raw calculated volumes for each currency pair on your screen.

Summary for the User

Essentially, this script acts as a real-time dashboard. Instead of you having to manually calculate the value of various currency positions across different markets, the tool does the heavy lifting instantly. It provides a clean, formatted list on your chart that tells you exactly what your exposure looks like across multiple pairs at once, allowing for faster decision-making and better risk management.

8 Views
0 Downloads
0 Favorites
swap_or_cost_point
//+------------------------------------------------------------------+ 
//| Cost of Point.mq4 | 
//| Copyright © 2005, Mindaugas, ìîäèô. Þã | 
//| http://viac.ru | 
//+------------------------------------------------------------------+ 
#property copyright "Copyright © 2005, Mindaugas, ìîäèô. Þã"
#property link "http://viac.ru" 

extern int     cost0_swap1=1;
extern double  lEURUSD=-0.7, lUSDCHF=1.1, lGBPUSD=0.09, lUSDJPY=1.2, lAUDUSD=0.24, lUSDCAD=0.23, 
               lEURCHF=0.49, lEURJPY=0.69, lEURGBP=-0.49, lGBPJPY=2.35, lGBPCHF=2.2; 
extern double  sEURUSD=0.53, sUSDCHF=-1.32, sGBPUSD=-0.37, sUSDJPY=-1.38, sAUDUSD=-0.35, sUSDCAD=-0.41, 
               sEURCHF=-0.73, sEURJPY=-0.89, sEURGBP=0.39, sGBPJPY=-2.68, sGBPCHF=-2.61; 


int init() { 
return(0); 
} 

int deinit() { 
return(0); 
} 

int start() { 

double lots = 0.1; 
double EURUSD, USDCHF, GBPUSD, USDJPY, AUDUSD, USDCAD, EURCHF, EURJPY, EURGBP, GBPJPY, GBPCHF; 

EURUSD=NormalizeDouble (10*lots,2); 
USDCHF=NormalizeDouble ((10/MarketInfo("USDCHF",MODE_BID)*lots),2); 
GBPUSD=NormalizeDouble (7*lots,2); 
USDJPY=NormalizeDouble ((1000/MarketInfo("USDJPY",MODE_BID)*lots),2); 
AUDUSD=NormalizeDouble (20*lots,2); 
USDCAD=NormalizeDouble ((10/MarketInfo("USDCAD",MODE_BID)*lots),2); 
EURCHF=NormalizeDouble ((10/MarketInfo("USDCHF",MODE_BID)*lots),2); 
EURJPY=NormalizeDouble ((1000/MarketInfo("USDJPY",MODE_BID)*lots),2); 
EURGBP=NormalizeDouble ((10*MarketInfo("GBPUSD",MODE_BID)*lots),2); 
GBPJPY=NormalizeDouble ((700/MarketInfo("USDJPY",MODE_BID)*lots),2); 
GBPCHF=NormalizeDouble ((7/MarketInfo("USDCHF",MODE_BID)*lots),2); 

if (cost0_swap1==1)
   {Comment 
         ("\nEURUSD "," | ",NormalizeDouble (EURUSD*lEURUSD,2)," | ",NormalizeDouble (EURUSD*sEURUSD,2), 
         "\nUSDCHF "," | ",NormalizeDouble (USDCHF*lUSDCHF,2)," | ",NormalizeDouble (USDCHF*sUSDCHF,2),
         "\nGBPUSD "," | ",NormalizeDouble (GBPUSD*lGBPUSD,2)," | ",NormalizeDouble (GBPUSD*sGBPUSD,2),
         "\nUSDJPY  "," | ",NormalizeDouble (USDJPY*lUSDJPY,2)," | ",NormalizeDouble (USDJPY*sUSDJPY,2), 
         "\nAUDUSD "," | ",NormalizeDouble (AUDUSD*lAUDUSD,2)," | ",NormalizeDouble (AUDUSD*sAUDUSD,2), 
         "\nUSDCAD "," | ",NormalizeDouble (USDCAD*lUSDCAD,2)," | ",NormalizeDouble (USDCAD*sUSDCAD,2),
         "\nEURCHF "," | ",NormalizeDouble (EURCHF*lEURCHF,2)," | ",NormalizeDouble (EURCHF*sEURCHF,2), 
         "\nEURJPY  "," | ",NormalizeDouble (EURJPY*lEURJPY,2)," | ",NormalizeDouble (EURJPY*sEURJPY,2), 
         "\nEURGBP "," | ",NormalizeDouble (EURGBP*lEURGBP,2)," | ",NormalizeDouble (EURGBP*sEURGBP,2), 
         "\nGBPJPY  "," | ",NormalizeDouble (GBPJPY*lGBPJPY,2)," | ",NormalizeDouble (GBPJPY*sGBPJPY,2), 
         "\nGBPCHF "," | ",NormalizeDouble (GBPCHF*lGBPCHF,2)," | ",NormalizeDouble (GBPCHF*sGBPCHF,2)); 
     }
if (cost0_swap1==0)
   {Comment 
         ("\nEURUSD "," | ",EURUSD, 
         "\nUSDCHF "," | ",USDCHF,
         "\nGBPUSD "," | ",GBPUSD,
         "\nUSDJPY  "," | ",USDJPY, 
         "\nAUDUSD "," | ",AUDUSD, 
         "\nUSDCAD "," | ",USDCAD,
         "\nEURCHF "," | ",EURCHF, 
         "\nEURJPY  "," | ",EURJPY, 
         "\nEURGBP "," | ",EURGBP, 
         "\nGBPJPY  "," | ",GBPJPY, 
         "\nGBPCHF "," | ",GBPCHF); 
     }
return(0); 
} 

Comments