| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Lower Time Frame Looking Back To Higher Time Frames https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5704 |
Page 1 of 2 |
| Author: | neville [ Mon Jul 08, 2019 10:11 am ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
Hello, very green coding newbie here, I have created my first indicator - it magically draws two lines. It looks back to the previous candle and at the high and low of that previous candle draws a horizontal line. I created the code, through watching videos, etc on youtube but from some investigation, a lot of the older videos are using a different rule for the syntax (i think that is what I mean to say). I also try and look through the mql4 docs from Empty4 but currently, they seem to have a lot of info within that I still can't pick out the nuggets that I need. I'll keep plugging away in my investigation but on the off chance someone can explain the process for what is basically finding PERIOD_D1 High, from within a lower time frame that would be a great nudge. I'll then go back through my installed indicators and see if I can spot how they did it. My ultimate idea is to find that price, then use it as a basis to add things, like lines that are 20 pips above yesterdays high but the starting point is definitely not coming easily to me Anyway, I am nev and I am new to here and coding but not to trading so maybe i'll also be able to add some value back one day. bye for now. |
|
| Author: | neville [ Mon Jul 08, 2019 2:55 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
It's called Lines 4 as I hope one day to have 4 lines on my charts Code: Select all |
|
| Author: | SteveHopwood [ Mon Jul 08, 2019 6:27 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
This returns the highest on the Daily, of the previous 24 bars, starting at the close of the previous bar. double high = iHigh( Symbol(), PERIOD_D1, iHighest( Symbol(), PERIOD_D1, MODE_HIGH, 24, 1 ) ); |
|
| Author: | neville [ Mon Jul 08, 2019 7:07 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
Thank you, I'll have a go at seeing if I have learned anything by trying your code in place. Also gives me something to search for within the installed indi's. so thanks again. |
|
| Author: | tomele [ Mon Jul 08, 2019 9:30 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
As Steve pointed out, the functions you should look up in the manual are iHigh iLow IHighest iLowest As soon as you understand those, you might want to re-organize your code. Indicators must not only do what you want, they also must be efficient and not eat up resources by brainlessly iterating things. That is the real challenge in coding indicators. Just a hint. Find things out for yourself. You are on a good path. Thomas |
|
| Author: | neville [ Tue Jul 09, 2019 6:28 am ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
Thank you Thomas That is something I would like to learn more about. In your opinion is it possible to learn those efficiencies via youtube? or is there an online course you would recommend? |
|
| Author: | tomele [ Tue Jul 09, 2019 8:55 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
Effective coding of indicators is an art you will only learn by investing lots of time in struggling with MQL. No one can spoonfeed you the knowledge that is needed for it. I don't know of any YT videos or online courses that would be very helpful. In fact, most of them are outdated. As an example, they teach you to use the old "special functions" init(), deinit() and start(). Meanwhile, we are using the more sophisticated event handlers OnInit(), OnDeinit(), OnTick(), OnCalculate(), OnTimer() and so on. Read about them in the MQL documentation. My first steps with MQL were analyzing existing indicators, looking up everything in the MQL documentation that I didn' completely understand and then trying to modify parts of the code and watch the results. Although I had a background as a coder in other languages, it took me quite a while to understand the basic concepts. Even today, the MQL documentation is my indispensable resource when coding. The basic syntax is easy, but there are just too many specific nuts and bolts. Nobody can remember them all. At least I can't. You might consider going the same route. If you get totally stuck, post intelligent questions and you will eventually see that you are member of a community very willing to help people sticking their nose "under the hood". Hope that gives you an idea. Thomas |
|
| Author: | neville [ Tue Jul 09, 2019 9:15 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
I am at that part where I fiddle with indicators etc. Trying to learn the reasons behind how some indicators work etc. is the tricky bit. I'll keep plugging away. Thank you for your kind words. |
|
| Author: | neville [ Mon Jul 15, 2019 9:06 am ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
Hello, I have new question: Having worked on defining a level, I now need to workout how to define Time on the charts, so as to be able to plot an OBJ_TREND Code: Select all Do I start with a new daily candle Open? Do I have to break it all down in 1440 minutes? or is there a way of say StartTime= EndTime =? Thanks for the help so far, I have a wonderful Horizontal Line at the High and Low of the previous day, attached is the code so far. Code: Select all |
|
| Author: | SteveHopwood [ Thu Jul 18, 2019 9:03 pm ] |
| Post subject: | Lower Time Frame Looking Back To Higher Time Frames |
neville, you have some thinking to do. I have not a clue what you are asking in your last post. More expert coders may have but have lost patience with you. Either way, you need to shut up and do some thinking for yourself. My EA code is littered with stuff provided by coders far better than me but here is why they were prepared to provide such code: I spent years and years and years battering away at this stuff until I worked out the solutions to the problems I was having. We are talking over a decade here. Then I started to attract the attention of the more professional coders here. The more I worked out for myself, the more they felt able to help me out. So stop asking, "Erm, what do I do next?" and start proving that you are worthy of help from people who would otherwise charge hundreds of dollars an hour for their service. Do that and they might be prepared to step in and help; they did for me. |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|