So your looking for code that draws the trendlines automatically? I've seen this before but they are not as good as manually drawing the lines.hannele wrote:Hi Brian,AnotherBrian wrote:Do you code?hannele wrote:Hi all
Would anyone know if there is a utility for coloured trend line drawing for different time frames, ie monthly automatically red when moving to weekly auto blue, daily auto orange etc so when I'll click to one hour I'll know what time frame trend line is which.
I have looked here of all utilities, indis and scripts but could not find anything.
cheers
hannele
Here is a levels script that sort of does that. Are you looking for the colour to be auto or the trendline draw? A script can be done to drag onto the chart and it would give you a coloured, labelled line that you can move around.
http://www.stevehopwoodforex.com/phpBB3 ... els#p71611
I've never seen what you ask for but it would make life that much easier for drawing.
nope I don't code, but right now I wish I could.
Thank you for showing me the above link unfortunately that coloured levels line is not what I meant, and as you said it would make life easier.
cheers
hannele
Helpful Utilities
-
AnotherBrian
Re: Helpful Utilities
-
hannele
- Trader
- Posts: 137
- Joined: Wed Sep 19, 2012 2:31 am
Re: Helpful Utilities
Hi Brian,AnotherBrian wrote:So your looking for code that draws the trendlines automatically? I've seen this before but they are not as good as manually drawing the lines.hannele wrote:Hi Brian,AnotherBrian wrote:Do you code?hannele wrote:Hi all
Would anyone know if there is a utility for coloured trend line drawing for different time frames, ie monthly automatically red when moving to weekly auto blue, daily auto orange etc so when I'll click to one hour I'll know what time frame trend line is which.
I have looked here of all utilities, indis and scripts but could not find anything.
cheers
hannele
Here is a levels script that sort of does that. Are you looking for the colour to be auto or the trendline draw? A script can be done to drag onto the chart and it would give you a coloured, labelled line that you can move around.
http://www.stevehopwoodforex.com/phpBB3 ... els#p71611
I've never seen what you ask for but it would make life that much easier for drawing.
nope I don't code, but right now I wish I could.
Thank you for showing me the above link unfortunately that coloured levels line is not what I meant, and as you said it would make life easier.
cheers
hannele
Not automatically ( I have seen that one too ). Idea is that I draw the trend lines in different timeframes but every time frame is automatically different colour so when I go on the small time frame in one glance I can see longer time frame trend lines and identify what timeframe they came from.
cheers
hannele
-
AnotherBrian
Re: Helpful Utilities
Screenshot, code, and file below.hannele wrote: Hi Brian,
Not automatically ( I have seen that one too ). Idea is that I draw the trend lines in different timeframes but every time frame is automatically different colour so when I go on the small time frame in one glance I can see longer time frame trend lines and identify what timeframe they came from.
cheers
hannele
This is a script - put it in experts/scripts folder. Drag it to the chart and it will draw a line for you that matches the colour you have defined for the current time frame.
Feel free to open up the file and change colours etc, it's easy to do, you could learn something, and the coders would rather have you learn these really really simple things. Line width can be adjusted as well, see comments inside the code.
To modify the code (don't be scared to do this, you can't "wreck" anything) - right click the file inside Empty4. "modify" - make the text changes, click the "compile" button at the top, try the script again. Keep doing this until you get what you want. If you press "compile" and a RED message appears at the bottom right after doing this - you have an error and this will probably confuse you. Start over with a fresh copy of the file.
Code: Select all
color LineColor = Orange;
int start() {
double Price_on_Drop = WindowPriceOnDropped();
datetime time = WindowTimeOnDropped();
int TimeNow;
int timeframe = Period();
string TF.Text = "undefined";
if(IsConnected()) {TimeNow = TimeCurrent();}
else {TimeNow = time;}
double point = 0;
if (Digits == 3 || Digits == 5) {
point = Point*10;
} else {
point = Point;
}
switch(timeframe) {
case 1 :
TF.Text = "1 Min";
LineColor = Black;//change this line for color - this one is for 1 min chart. the color names can be seen in other indicators
break;
case 5 :
TF.Text = "5 Min";
LineColor = Black;
break;
case 15 :
TF.Text = "15 Min";
LineColor = Violet;
break;
case 30 :
TF.Text = "30 Min";
LineColor = Black;
break;
case 60 :
TF.Text = "1Hr";
LineColor = Orange;
break;
case 240 :
TF.Text = "4Hr";
LineColor = Blue;
break;
case 1440 :
TF.Text = "Daily";
LineColor = Brown;
break;
case 10080 :
TF.Text = "Weekly";
LineColor = Green;
break;
case 43200 :
TF.Text = "Monthly";
LineColor = Red;
break;
}
string LevelName = TF.Text + "_level__id:" + Price_on_Drop;
string LevelNameFill = TF.Text + "_level__id_fill:" + Price_on_Drop;
ObjectCreate(LevelName, OBJ_TREND, 0, time,Price_on_Drop, time+Period()*60*100,Price_on_Drop);
ObjectSet(LevelName,OBJPROP_RAY,1);//make the lines continue to the right
ObjectSet(LevelName,OBJPROP_COLOR, LineColor);
ObjectSet(LevelName,OBJPROP_BACK,1);
ObjectSet(LevelName,OBJPROP_WIDTH,2);//the width of the line
ObjectSet(LevelName,OBJPROP_FONTSIZE,14);
ObjectSetText( LevelName, TF.Text, 0, "", CLR_NONE);
return(0);
}
You do not have the required permissions to view the files attached to this post.
-
hannele
- Trader
- Posts: 137
- Joined: Wed Sep 19, 2012 2:31 am
Re: Helpful Utilities
Thank you thank you thank youAnotherBrian wrote:Screenshot, code, and file below.hannele wrote: Hi Brian,
Not automatically ( I have seen that one too ). Idea is that I draw the trend lines in different timeframes but every time frame is automatically different colour so when I go on the small time frame in one glance I can see longer time frame trend lines and identify what timeframe they came from.
cheers
hannele
This is a script - put it in experts/scripts folder. Drag it to the chart and it will draw a line for you that matches the colour you have defined for the current time frame.
Feel free to open up the file and change colours etc, it's easy to do, you could learn something, and the coders would rather have you learn these really really simple things. Line width can be adjusted as well, see comments inside the code.
To modify the code (don't be scared to do this, you can't "wreck" anything) - right click the file inside Empty4. "modify" - make the text changes, click the "compile" button at the top, try the script again. Keep doing this until you get what you want. If you press "compile" and a RED message appears at the bottom right after doing this - you have an error and this will probably confuse you. Start over with a fresh copy of the file.
Code: Select all
color LineColor = Orange; int start() { double Price_on_Drop = WindowPriceOnDropped(); datetime time = WindowTimeOnDropped(); int TimeNow; int timeframe = Period(); string TF.Text = "undefined"; if(IsConnected()) {TimeNow = TimeCurrent();} else {TimeNow = time;} double point = 0; if (Digits == 3 || Digits == 5) { point = Point*10; } else { point = Point; } switch(timeframe) { case 1 : TF.Text = "1 Min"; LineColor = Black;//change this line for color - this one is for 1 min chart. the color names can be seen in other indicators break; case 5 : TF.Text = "5 Min"; LineColor = Black; break; case 15 : TF.Text = "15 Min"; LineColor = Violet; break; case 30 : TF.Text = "30 Min"; LineColor = Black; break; case 60 : TF.Text = "1Hr"; LineColor = Orange; break; case 240 : TF.Text = "4Hr"; LineColor = Blue; break; case 1440 : TF.Text = "Daily"; LineColor = Brown; break; case 10080 : TF.Text = "Weekly"; LineColor = Green; break; case 43200 : TF.Text = "Monthly"; LineColor = Red; break; } string LevelName = TF.Text + "_level__id:" + Price_on_Drop; string LevelNameFill = TF.Text + "_level__id_fill:" + Price_on_Drop; ObjectCreate(LevelName, OBJ_TREND, 0, time,Price_on_Drop, time+Period()*60*100,Price_on_Drop); ObjectSet(LevelName,OBJPROP_RAY,1);//make the lines continue to the right ObjectSet(LevelName,OBJPROP_COLOR, LineColor); ObjectSet(LevelName,OBJPROP_BACK,1); ObjectSet(LevelName,OBJPROP_WIDTH,2);//the width of the line ObjectSet(LevelName,OBJPROP_FONTSIZE,14); ObjectSetText( LevelName, TF.Text, 0, "", CLR_NONE); return(0); }
-
dietcoke
- Trader
- Posts: 162
- Joined: Tue Nov 15, 2011 9:59 pm
Re: Helpful Utilities
Thats very clever BrianAnotherBrian wrote:Screenshot, code, and file below.hannele wrote: Hi Brian,
Not automatically ( I have seen that one too ). Idea is that I draw the trend lines in different timeframes but every time frame is automatically different colour so when I go on the small time frame in one glance I can see longer time frame trend lines and identify what timeframe they came from.
cheers
hannele
This is a script - put it in experts/scripts folder. Drag it to the chart and it will draw a line for you that matches the colour you have defined for the current time frame.
Feel free to open up the file and change colours etc, it's easy to do, you could learn something, and the coders would rather have you learn these really really simple things. Line width can be adjusted as well, see comments inside the code.
To modify the code (don't be scared to do this, you can't "wreck" anything) - right click the file inside Empty4. "modify" - make the text changes, click the "compile" button at the top, try the script again. Keep doing this until you get what you want. If you press "compile" and a RED message appears at the bottom right after doing this - you have an error and this will probably confuse you. Start over with a fresh copy of the file.
-
Kissa
- Posts: 6
- Joined: Mon Aug 20, 2012 4:44 pm
Re: Helpful Utilities
Absolutely sweet, just what i need for some setups, direct into the favorites.AnotherBrian wrote:
Screenshot, code, and file below.
Thank You.
- cadolino
- Trader
- Posts: 35
- Joined: Tue Jan 10, 2012 11:16 am
Re: Helpful Utilities
this is an amazing time tool / eClock from Mladen...it works exactly and doesn't need any tick data to work...it runs 24/7 even if the advisors are disabled ( it belongs to the advisor-folder, because it uses an endless Loop )...
regards
Cado
regards
Cado
You do not have the required permissions to view the files attached to this post.
Last edited by cadolino on Wed Aug 28, 2013 3:15 pm, edited 1 time in total.
-
AnotherBrian
Re: Helpful Utilities
cadolino wrote:this is an amazing time tool / eClock from Mladen...it works exactly and doesn't need any tick data to work...it runs 24/7 even if the advisors are disabled ( it belongs to the advisor-folder, because it uses an endless Loop )...
regards
Cado
... and what does it do, tell us, help us? Screen shot? Something to do with the time?
Can you edit your post to include more information? Thanks!
- cadolino
- Trader
- Posts: 35
- Joined: Tue Jan 10, 2012 11:16 am
Re: Helpful Utilities
sorry for my nightmare english but i have no other...
it's a candle clock that counts the time left till the candle closes - on every TF...
the best clock for Empty4 i ever saw...
regards
Cado
it's a candle clock that counts the time left till the candle closes - on every TF...
the best clock for Empty4 i ever saw...
regards
Cado
You do not have the required permissions to view the files attached to this post.
