Hi all, I have an indicator that shows me current symbol price, but I want to watch any symbol price in one chart
This is my indicators code:
Can anyone help me? How can I add any symbol into this code?
This is my indicators code:
QuoteDisliked#property indicator_chart_window
extern int WhatCorner = 3;
double lastPrice = 0.0;
color FontColor;
int dig;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if(Digits == 5)
dig = 4;
else if(Digits == 3)
dig = 2;
else
dig = Digits;
return(0);
}
int deinit()
{
ObjectDelete("Market_Price_Label");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
if(Close[0] > lastPrice)
{
FontColor = Lime;
}
if(Close[0] < lastPrice)
{
FontColor = OrangeRed;
}
lastPrice = Close[0];
string Market_Price = DoubleToStr(Bid, dig);
ObjectCreate("Market_Price_Label", OBJ_LABEL, 0, 0, 0);
ObjectSetText("Market_Price_Label", Market_Price, 28, "Arial Bold", FontColor);
ObjectSet("Market_Price_Label", OBJPROP_CORNER, WhatCorner);
ObjectSet("Market_Price_Label", OBJPROP_XDISTANCE, 2);
ObjectSet("Market_Price_Label", OBJPROP_YDISTANCE, 1);
return(0);
}
Can anyone help me? How can I add any symbol into this code?
"Rule No.1: Never lose money. Rule No.2: Never forget rule No.1." — Warren