lines to rectangles - page 2

 
Yango # :

yes

Run this code. It's the weekend and you need to manually update the schedule.

How this code works: as soon as a new rectangle appears (or the name of the rectangle changes), two trend lines will be drawn.

Example:


 
Vladimir Karputov #:

Run this code. It's the weekend and you need to manually update the schedule.

How this code works: as soon as a new rectangle appears (or the name of the rectangle changes), two trend lines will be drawn.

Example:


that looks good, thank you!. I have to deal with that a bit now, so that I can see through it.. could adapt my for loop with this code.

 
Yango # :

that looks good, thank you!. I have to deal with that a bit now, so that I can see through it.. could adapt my for loop with this code.

Your code (in which there is a loop through all objects) needs to be thrown out. You need to use event model - work inside 'OnChartEvent'.

 
Vladimir Karputov #:

Your code (in which there is a loop through all objects) needs to be thrown out. You need to use event model - work inside 'OnChartEvent'.

I just did that. I tried everything with the onchart version but it didn't insert any lines for me. so that's pretty much how i put it in

 
Vladimir Karputov #:

Your code (in which there is a loop through all objects) needs to be thrown out. You need to use event model - work inside 'OnChartEvent'.


but in the strategy tester it should work normally, right?
 
Yango # :

but in the strategy tester it should work normally, right?

No. Events do not work in the strategy tester.

 
Vladimir Karputov #:

No. Events do not work in the strategy tester.

I have to somehow insert the code into my EA. since my EA uses an indicator the indicator sets the rectangles and the EA locates them and then is supposed to set the lines