gctex Posted May 1, 2011 Report Share Posted May 1, 2011 I am looking for a Trend Line Indicator that can plot the following: 1) Upper line connecting the higher high of the last 12 bars of the previous day with the higher high of the last 3 bars of the current day and 2) Lower line connecting the lower low of the last 12 bars of the previous day with the lower low of the last 3 bars of the current day Does anyone have such an indicator please? smurf43 1 Quote Link to comment Share on other sites More sharing options...
soundfx Posted May 1, 2011 Report Share Posted May 1, 2011 This sort of indicator should be simple to code, however which bars are you referring to ? I'm assuming 1H bars though I may be wrong :-/ As an added incentive for anyone coding the indicator it would be handy to know how it will help you in selecting high probability trades ;) Quote Link to comment Share on other sites More sharing options...
gctex Posted May 1, 2011 Author Report Share Posted May 1, 2011 Yeah, I am referring to the 1 H bars. Basically it is yet another trend line breakout stuff. Anything breaking the upper line, buy. Anything the breaking the lower line, sell. Both during the London hours. Visually, it does seem to hold promise. :) Quote Link to comment Share on other sites More sharing options...
soundfx Posted May 1, 2011 Report Share Posted May 1, 2011 Hi gctex, I had a bit of spare time so I've attempted to create this indicator. It looks to be working ok, though let me know of any problems. http://www.multiupload.com/Q26QNVJLNI ⭐ E2U, gctex and smurf43 3 Quote Link to comment Share on other sites More sharing options...
gctex Posted May 1, 2011 Author Report Share Posted May 1, 2011 Hi gctex, I had a bit of spare time so I've attempted to create this indicator. It looks to be working ok, though let me know of any problems. http://www.multiupload.com/Q26QNVJLNI Beautiful !!! that's pretty much I can say about it ... :) Thanks a great lot. If possible, can you please add these: 1) Can you also display the buffer values of upper & lower trend lines so that I can call it from an EA? 2) It draws the trend lines for the latest day. Is it possible to draw the trend lines for each previous day? (Would be helpful for easy visual confirmation) Thanks once again Quote Link to comment Share on other sites More sharing options...
smurf43 Posted May 1, 2011 Report Share Posted May 1, 2011 (edited) Hi gctex As you know, different Brokers' MT4 Platforms may have different day-start/ day-end (e.g. GMT midnight, US Eastern midnight). So the resulting trend lines could be different. Could you please tell us, what is the day-start/day-end you consider for this strategy. Edited May 1, 2011 by smurf43 Quote Link to comment Share on other sites More sharing options...
soundfx Posted May 2, 2011 Report Share Posted May 2, 2011 hi gctex, I'm glad to hear that the basic indicator is what you were looking for :) Regarding your point 1) Currently the indicator doesn't use buffers at all, though we should be able to write the High start and end prices and Low start and end prices into 4 "dummy" buffers. Point 2) I'm not so sure that's going to be a good idea as things stand, though I can see it would be handy for manually backtesting. Drawing trendlines for each previous day going back as far as the bars on the chart as currently coded means that you're going to end up with lines everywhere and total confusion lol. Ideally, we'd need the trendlines to stop at the end point for each day rather than have all of them drawing lines into the future. I've not got time to make these changes myself right now, though there are plenty of coders around here who should be able to help. gctex 1 Quote Link to comment Share on other sites More sharing options...
gctex Posted May 2, 2011 Author Report Share Posted May 2, 2011 Yeah smurf, I am going by 3:00 AM CST. Here are more details about this strategy. http://forex-strategies-revealed.com/advanced/trendlines-breakout I guess someone already wrote an EA about it, if you wish to check it out: http://forums.forex-strategies-revealed.com/advanced-system-trend-lines-breakout-system-t218-130.html SoundFx's indicator works just fine, if only it can be made to draw the trend lines for all previous days plus the buffer values, then I can just plug it into my existing EA and test it fine. smurf43 1 Quote Link to comment Share on other sites More sharing options...
fxeasy5 Posted May 2, 2011 Report Share Posted May 2, 2011 The indicator is crashing my Mt4. (4digit broker) Quote Link to comment Share on other sites More sharing options...
gctex Posted May 2, 2011 Author Report Share Posted May 2, 2011 Well when I tested it during the weekend it looked fine, but now the start points of these trend lines are not restricted to the last 12 bars of the previous day. It tries to to draw the trend lines from a few days before. Not sure why. Quote Link to comment Share on other sites More sharing options...
soundfx Posted May 2, 2011 Report Share Posted May 2, 2011 gctex, Try putting the following lines after the line "Yesterday = Today - 1;" if (TimeDayOfWeek(iTime(NULL,0,0)) == 0) Yesterday = Today - 2; if (TimeDayOfWeek(iTime(NULL,0,0)) == 1) Yesterday = Today - 3; fxeasy5, I'm not an expert coder and didn't even consider that 4 digit brokers would make a difference (in fact I didn't realise they still existed lol). There's still nothing obvious that I can see in the code which should cause a crash. Quote Link to comment Share on other sites More sharing options...
gctex Posted May 2, 2011 Author Report Share Posted May 2, 2011 Hey soundfx that worked! ... now I know u r busy so I am trying to add the buffers myself. If you can please let me know if this looks ok I'd be grateful. =================== #property indicator_buffers 2 -------------- double Up[]; double Dn[]; ------------- SetIndexBuffer(0, Up); SetIndexBuffer(1, Dn); -------------- string nameh = "HighLine"; string namel = "LowLine"; ------------- if (iHigh(NULL,0,BarCount) > HighLineEnd) { HighLineEnd = iHigh(NULL,0,BarCount); HighLineEndTime = iTime(NULL,0,BarCount); datetime time0L; if (ObjectFind(nameh) != -1) { double tlh = ObjectGetValueByShift(nameh, 0); if (time0L != Time[0]){ Up[0] = tlh; } } } ------------- The above code is (my humble attempt) to print the Upper buffer value. For some reason it doesn't work right. Btw, you mentioned 4 buffers but then you have only two objects "HighLine" & "LowLine". So why you need 4 buffers? Quote Link to comment Share on other sites More sharing options...
soundfx Posted May 2, 2011 Report Share Posted May 2, 2011 Hi gtctex, Yep, you're right you only need two buffers. Have a look at this one: http://www.multiupload.com/NFG1G3VOQ2 gctex and ⭐ Ormazd 2 Quote Link to comment Share on other sites More sharing options...
gctex Posted May 3, 2011 Author Report Share Posted May 3, 2011 Works fine soundfx. Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.