ProfitChart
Download scriptThis tool is designed to provide a comprehensive overview of market performance by calculating and visualizing the cumulative profit potential across multiple currency pairs simultaneously. Rather than looking at a single chart, this script aggregates data from a diverse basket of "Buy" and "Sell" positions to help traders understand the overall momentum of the market.
How the Logic Works
The script operates by analyzing several different currency pairs at the exact same time on your chart. It categorizes these pairs into two distinct groups:
1. The Buy Group The tool tracks seven specific currency pairs (including combinations like GBPUSD, EURGBP, and AUDJPY). For each of these, it calculates the price movement from the opening of a candle to its closing. By adding all these movements together, the script generates a "Buy Profit" value. This represents how well the market is performing for long positions across that specific group.
2. The Sell Group Simultaneously, the tool tracks a second set of seven currency pairs (including combinations like EURUSD, USDJPY, and EURCHF). However, it calculates these in the opposite direction—measuring the price drop from the open to the close. It then sums these values to create a "Sell Profit" figure, representing the performance for short positions.
Visual Representation
The script outputs three distinct lines on a separate window below your main chart:
- Buy Performance: A blue line that tracks the collective movement of the first group of currency pairs.
- Sell Performance: A red line that tracks the collective movement of the second group of currency pairs.
- Total Combined Profit: A yellow line that merges both the Buy and Sell performances into a single value.
Summary for the Trader
Instead of forcing you to monitor fourteen different charts to see where the "strength" in the market lies, this script consolidates that data into one view. It allows you to see at a glance whether the overall market sentiment is leaning toward the "Buy" side, the "Sell" side, or if the movements are neutralizing each other out.
//+------------------------------------------------------------------+
//| |
//| Profit |
//| Developed by Trader101 |
//| trader101@optonline.net |
//+------------------------------------------------------------------+
#property link "Julius Figueroa -- trader101@optonline.net"
#property copyright "trader101"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Yellow
double guProfit,egProfit,gjProfit, ucProfit ,nuProfit ,ajProfit, ejProfit, buyProfit, sellProfit;
double bProfit[], sProfit[], Profit[];
double euProfit,ujProfit,auProfit, njProfit ,gcProfit ,cjProfit, ecProfit;
//+-----------------------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,bProfit);
//ArrayInitialize(bProfit,EMPTY_VALUE);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,sProfit);
//ArrayInitialize(sProfit,EMPTY_VALUE);
SetIndexStyle(2,DRAW_LINE,0,2);
SetIndexBuffer(2,Profit);
//ArrayInitialize(sProfit,EMPTY_VALUE);
return(0);
}
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
for(i=limit; i>=0; i--)
{
//--for GBPUSD
guProfit = (iClose("GBPUSDm",Period(),i)- iOpen("GBPUSDm",Period(),i))/Point;
egProfit = (iClose("EURGBPm",Period(),i)- iOpen("EURGBPm",Period(),i))/Point;
gjProfit = (iClose("GBPJPYm",Period(),i)- iOpen("GBPJPYm",Period(),i))/Point;
ucProfit = (iClose("USDCHFm",Period(),i)- iOpen("USDCHFm",Period(),i))/Point;
nuProfit = (iClose("NZDUSDm",Period(),i)- iOpen("NZDUSDm",Period(),i))/Point;
ajProfit = (iClose("AUDJPYm",Period(),i)- iOpen("AUDJPYm",Period(),i))/Point;
ejProfit = (iClose("EURJPYm",Period(),i)- iOpen("EURJPYm",Period(),i))/Point;
buyProfit = guProfit+ egProfit+ gjProfit+ ucProfit+ nuProfit+ ajProfit+ ejProfit;
bProfit[i] = buyProfit;
euProfit = (iOpen("EURUSDm",Period(),i)- iClose("EURUSDm",Period(),i))/Point;
ujProfit = (iOpen("USDJPYm",Period(),i)- iClose("USDJPYm",Period(),i))/Point;
auProfit = (iOpen("AUDUSDm",Period(),i)- iClose("AUDUSDm",Period(),i))/Point;
njProfit = (iOpen("NZDJPYm",Period(),i)- iClose("NZDJPYm",Period(),i))/Point;
gcProfit = (iOpen("GBPCHFm",Period(),i)- iClose("GBPCHFm",Period(),i))/Point;
cjProfit = (iOpen("CHFJPYm",Period(),i)- iClose("CHFJPYm",Period(),i))/Point;
ecProfit = (iOpen("EURCHFm",Period(),i)- iClose("EURCHFm",Period(),i))/Point;
sellProfit = euProfit+ ujProfit+ auProfit+ njProfit+ gcProfit+ cjProfit+ ecProfit;
sProfit[i] = sellProfit;
//Profit[i] = bProfit + sProfit;
Profit[i] = buyProfit + sellProfit;
}
//Comment(Profit[0]);
return(0);
}
//+------------------------------------------------------------------+
Comments