jizzle15: Yes this is how it looks. (the red line are supposed to display the previous daily weekly and monthly high and low) but as you can see there is a huge number of lines..if i click on each of them there is a label that display ex:Previous dailyHigh[8] and another would be Previous dailyHigh[7]
Thanks for your help Mladen
It looks like this when I attach it to the chart :
Are you trying t use multiple instances of the indicator on the same chart
No, i just changed the line style in the indicator setting box so it's easier to see. But as you can see, there are the levels in front of the labels, and some extra lines that i don't know what they are referring to
morenokosta: I am very happy, and how do I compile the code by yourself posted
That is not an indicator, or an ea or a script
The man asked for a solution for a specific problem (see his original post here : original request from sunshineh ). Those two are solutions for his specific problem. If you want to see how it can be applied in an indicator, for example, here is one example :
#property indicator_chart_window
int init() { return(0); }
int deinit() { return(0); }
void start(void)
{
string name = "test";
long current = ChartFirst();
while (true)
{
if (ChartSymbol(current)=="CADCHF" && ChartPeriod(current)==PERIOD_H1)
{
if (!ObjectCreate(current,name, OBJ_ARROW, 0, TimeCurrent(),MarketInfo("CADCHF",MODE_BID)))
{
Alert("Error creating object: ",GetLastError());
break;
}
}
current = ChartNext(current); if (current==-1) break;
Attach it to any chart and then open as many CADCHF 1 hour charts you want, go to the chart where you attached the _test indicator, wait for a tick or, today, change a time frame, and then check all the CADCHF charts - on all you will see one arrow created. That is what sunshineh's problem was and that is what that code was supposed to do
mladen: That is not an indicator, or an ea or a script
The man asked for a solution for a specific problem (see his original post here : original request from sunshineh ). Those two are solutions for his specific problem. If you want to see how it can be applied in an indicator, for example, here is one example :
#property indicator_chart_window
int init() { return(0); }
int deinit() { return(0); }
void start(void)
{
string name = "test";
long current = ChartFirst();
while (true)
{
if (ChartSymbol(current)=="CADCHF" && ChartPeriod(current)==PERIOD_H1)
{
if (!ObjectCreate(current,name, OBJ_ARROW, 0, TimeCurrent(),MarketInfo("CADCHF",MODE_BID)))
{
Alert("Error creating object: ",GetLastError());
break;
}
}
current = ChartNext(current); if (current==-1) break;
Attach it to any chart and then open as many CADCHF 1 hour charts you want, go to the chart where you attached the _test indicator, wait for a tick or, today, change a time frame, and then check all the CADCHF charts - on all you will see one arrow created. That is what sunshineh's problem was and that is what that code was supposed to do
mladen: It looks like this when I attach it to the chart :
Are you trying t use multiple instances of the indicator on the same chart
Re: Coding help
No, i just changed the line style in the indicator setting box so it's easier to see. But as you can see, there are the levels in front of the labels, and some extra lines that i don't know what they are referring to
No, i just changed the line style in the indicator setting box so it's easier to see. But as you can see, there are the levels in front of the labels, and some extra lines that i don't know what they are referring to
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Yes this is how it looks. (the red line are supposed to display the previous daily weekly and monthly high and low) but as you can see there is a huge number of lines..if i click on each of them there is a label that display ex:Previous dailyHigh[8] and another would be Previous dailyHigh[7]
Thanks for your help Mladen
It looks like this when I attach it to the chart :
Are you trying t use multiple instances of the indicator on the same chart
No, i just changed the line style in the indicator setting box so it's easier to see. But as you can see, there are the levels in front of the labels, and some extra lines that i don't know what they are referring to
'
Try like this :
while (true)
{
if (ChartSymbol(current)=="CADCHF" && ChartPeriod(current)==PERIOD_H1) break;
current = ChartNext(current); if (current==-1) break;
}
if (current!=-1)
if (!ObjectCreate(current,name, OBJ_ARROW, 0, TimeCurrent(),MarketInfo("CADCHF",MODE_BID)))
{
Alert("Error creating object: ",GetLastError());
return;
}
[/PHP]
Or if you want to draw that object on each and every CADCHF H1 chart, do it like this :
[PHP]long current = ChartFirst();
while (true)
{
if (ChartSymbol(current)=="CADCHF" && ChartPeriod(current)==PERIOD_H1)
{
if (!ObjectCreate(current,name, OBJ_ARROW, 0, TimeCurrent(),MarketInfo("CADCHF",MODE_BID)))
{
Alert("Error creating object: ",GetLastError());
break;
}
}
current = ChartNext(current); if (current==-1) break;
}
it would be nice if he found the solution
it would be nice if he found the solution
That is the solution (both solutions are working - tested it)
That is the solution (both solutions are working - tested it)
I am very happy, and how do I compile the code by yourself posted
I am very happy, and how do I compile the code by yourself posted
That is not an indicator, or an ea or a script
The man asked for a solution for a specific problem (see his original post here : original request from sunshineh ). Those two are solutions for his specific problem. If you want to see how it can be applied in an indicator, for example, here is one example :
int init() { return(0); }
int deinit() { return(0); }
void start(void)
{
string name = "test";
long current = ChartFirst();
while (true)
{
if (ChartSymbol(current)=="CADCHF" && ChartPeriod(current)==PERIOD_H1)
{
if (!ObjectCreate(current,name, OBJ_ARROW, 0, TimeCurrent(),MarketInfo("CADCHF",MODE_BID)))
{
Alert("Error creating object: ",GetLastError());
break;
}
}
current = ChartNext(current); if (current==-1) break;
}
return;
}_test_1.mq4
Attach it to any chart and then open as many CADCHF 1 hour charts you want, go to the chart where you attached the _test indicator, wait for a tick or, today, change a time frame, and then check all the CADCHF charts - on all you will see one arrow created. That is what sunshineh's problem was and that is what that code was supposed to do
happy trading
That is not an indicator, or an ea or a script
The man asked for a solution for a specific problem (see his original post here : original request from sunshineh ). Those two are solutions for his specific problem. If you want to see how it can be applied in an indicator, for example, here is one example :
int init() { return(0); }
int deinit() { return(0); }
void start(void)
{
string name = "test";
long current = ChartFirst();
while (true)
{
if (ChartSymbol(current)=="CADCHF" && ChartPeriod(current)==PERIOD_H1)
{
if (!ObjectCreate(current,name, OBJ_ARROW, 0, TimeCurrent(),MarketInfo("CADCHF",MODE_BID)))
{
Alert("Error creating object: ",GetLastError());
break;
}
}
current = ChartNext(current); if (current==-1) break;
}
return;
}_test_1.mq4
Attach it to any chart and then open as many CADCHF 1 hour charts you want, go to the chart where you attached the _test indicator, wait for a tick or, today, change a time frame, and then check all the CADCHF charts - on all you will see one arrow created. That is what sunshineh's problem was and that is what that code was supposed to do
happy tradingthank you, i try it and let you know
It looks like this when I attach it to the chart :

Are you trying t use multiple instances of the indicator on the same chartRe: Coding help
Sorry. Can not find what is going on with it
Sorry. Can not find what is going on with it
Ok no problem, i will use it just like that thanks