You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If you use the code as an indicator the lines will move to the right automatically.
Sorry, it needs to be a script as I am going to incorporate it as part of a buy script so it draws the lines automatically (target lines).
I added ray = true but it now draws the line across the whole page all the way to the left where it should really be going the other way :)
Sorry, it needs to be a script as I am going to incorporate it as part of a buy script so it draws the lines automatically (target lines).
I added ray = true but it now draws the line across the whole page all the way to the left where it should really be going the other way :)
If you write a script there's no need to run the whole for cycle. It's a waste of time. You may use this:
//testing variable
double inputlevel = 1.4;
int i;
double level1=inputlevel+(20*Point*10); //+20pips
double level2=inputlevel+(30*Point*10); //+30pips
double level3=inputlevel+(40*Point*10); //+40pips
double level4=inputlevel+(80*Point*10); //+80pips
datetime dtStart = iTime(NULL,PERIOD_M15,4);
datetime dtEnd = iTime(NULL,PERIOD_M15,0);
ObjectDelete("Line1");
ObjectCreate("Line1",OBJ_TREND,0,dtStart,level1, dtEnd, level1);
ObjectSet("Line1",OBJPROP_COLOR,Red);
ObjectSet("Line1",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("Line1", OBJPROP_RAY, false);
ObjectSet("Line1",OBJPROP_WIDTH,1);
.............................................................
But I'm not sure what you're trying to do.. and why you want the lines to move right. If it is a script it executes, draws the lines, open trades and exits. And that's all.
If you write a script there's no need to run the whole for cycle. It's a waste of time. You may use this:
//testing variable
double inputlevel = 1.4;
int i;
double level1=inputlevel+(20*Point*10); //+20pips
double level2=inputlevel+(30*Point*10); //+30pips
double level3=inputlevel+(40*Point*10); //+40pips
double level4=inputlevel+(80*Point*10); //+80pips
datetime dtStart = iTime(NULL,PERIOD_M15,4);
datetime dtEnd = iTime(NULL,PERIOD_M15,0);
ObjectDelete("Line1");
ObjectCreate("Line1",OBJ_TREND,0,dtStart,level1, dtEnd, level1);
ObjectSet("Line1",OBJPROP_COLOR,Red);
ObjectSet("Line1",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("Line1", OBJPROP_RAY, false);
ObjectSet("Line1",OBJPROP_WIDTH,1);
.............................................................
But I'm not sure what you're trying to do.. and why you want the lines to move right. If it is a script it executes, draws the lines, open trades and exits. And that's all.
I had to swap the dtEnd and dtStart round so it would draw Ray lines to the right.
I think I need to leave the loop in or it doesn't know where to start the Bars from.
Thanks for your help.
I had to swap the dtEnd and dtStart round so it would draw Ray lines to the right.
I think I need to leave the loop in or it doesn't know where to start the Bars from.
Thanks for your help.
You're welcome. Good luck!
Please let me ask again,
what's the point of the (...still buggy...) loop? What does it do besides the heating CPU and delaying start() execution?
I'm really curious.
I agree but if you don't add the loop, it draws a line across the entire screen. Must be something to do with finding the bars.
?