Hello
I'm looking for info on how I could code, if it is possible, to replicate a trend line on all time frame. I found it annoying to redraw same line on each time frame that I use.
There should be a solution, but I just don't know from where to start.
Happy weekend to all
Martin
Replicating trend lines one multiple time frame
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Replicating trend lines one multiple time frame
are you talking about manually drawn trendlines?Hello
I'm looking for info on how I could code, if it is possible, to replicate a trend line on all time frame. I found it annoying to redraw same line on each time frame that I use.
There should be a solution, but I just don't know from where to start.
Happy weekend to all
Martin
My lines stay in the chart when I change the resolution.
Re: Replicating trend lines one multiple time frame
Hello TJ
Yes, manually draw trend line .
I'm using different windows chart. Individual time frame for each pane. The chart application that I was using before, from Saxo Bank, had an option to draw the same trend line on each charts of the same instrument.
Draw once, for all time frame.
Martin
Yes, manually draw trend line .
I'm using different windows chart. Individual time frame for each pane. The chart application that I was using before, from Saxo Bank, had an option to draw the same trend line on each charts of the same instrument.
Draw once, for all time frame.
Martin
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Replicating trend lines one multiple time frame
Hm, how much spare time do you have?(..) draw the same trend line on each charts of the same instrument.
Draw once, for all time frame.
No seriously, I think it can be done with...
1) GlobalVariables that hold the start time, end time, start price and end price for the trend line, and a indicator that uses RecalcLastBarAfter() to periodically check for these global variables. If a new trend line is "found" in the GlobalVariables, this would need to be saved in other variables to prevent it from getting overwritten. This means that you only need to keep track of four global variables per instrument.
However, I do not know if this will work with existing trend lines, for example when you have two trendlines already on the chart from yesterday on the 15M time frame, how should the 5M know these? You could loop through the bars of the previous session, but if you have 5 time frames, how should one prevent the mingling up of the different variables?
2) With the ELCollection function that read text files. You can write the location of a trend line to a file, and then let another indicator "pull" these from the file. This would make it easier to have 'historical trendlines' (trendlines that you draw a previous session) across all charts. (I don't think this is a good or quick to code solution, but I wanted to present more than one way. )
Just thinking aloud,
Re: Replicating trend lines one multiple time frame
That is a good start John
- Reading existing trendline value
- Store these one in a Global Variable using CSV text string
On another chart
- Erase all trend line
- Read back GV and decode trendline data
- Redraw trendline
Hum nice project. Look feasible, but not as easy as I first thought.
Martin
- Reading existing trendline value
- Store these one in a Global Variable using CSV text string
On another chart
- Erase all trend line
- Read back GV and decode trendline data
- Redraw trendline
Hum nice project. Look feasible, but not as easy as I first thought.
Martin