| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Trend Indi for levels https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5387 |
Page 1 of 1 |
| Author: | McNish [ Tue Feb 06, 2018 8:59 pm ] |
| Post subject: | Trend Indi for levels |
Hello Everyone, I want to request a trend indicator to show up trend or down trend based on round numbers on a 5 digit broker. By round numbers i mean the full, half and quarter levels of price. For EU they would be something like 1.22000 (full), 1.22250 or 1.22750 (quarter), 1.22500 (half). For example if the last round number that EU touched was 1.23500 and prior to that the round number that it touched was 1.23750, the trend would be Down. That means EU travelled from 1.23750 to 1.23500, thus the trend is Down. Similarly, if the last RN touched was 1.23250 and the RN touched before that was 1.23000, the trend would be up. That means the EU travelled from 1.23000 to 1.23250, thus the trend is UP. This is an element for an idea for possiable automation. I have the shell EA and the code for other elements. Hopefully some will lend a helping hand. Much Obliged. Cheers, Max. |
|
| Author: | SteveHopwood [ Wed Feb 07, 2018 12:24 am ] |
| Post subject: | Trend Inid for levels |
I am not, absolutely not preventing indi coders from stepping in here and helping out. Please do, if you feel so inclined indi coders. Fact is Max, that this is the sort of post they would have reacted favourably to back when SHF started. Not so any more. SHF has moved so far from its origination that it is sometimes hard to believe it is still the same forum. In many ways, it is not. So many ways. Nowadays, you have to offer coders a reason to code the indi/EA you want i.e. show some evidence of successful manual trading using your method before the coders will step in and generate what you want. Give this some thought. |
|
| Author: | McNish [ Wed Feb 07, 2018 6:05 pm ] |
| Post subject: | Trend Inid for levels |
Sire, :hi: Thank you for the forum, once again. I get your point very well. I'll do the code today. Cheers & Regards, Max |
|
| Author: | McNish [ Thu Feb 08, 2018 10:35 pm ] |
| Post subject: | Trend Indi for levels |
Your Highness, Have managed to put together sembelance of a code, but it freezes the platform when i put it on a chart. Can i upload the code file here with a request to be looked into it and rectified? |
|
| Author: | tomele [ Thu Feb 08, 2018 10:49 pm ] |
| Post subject: | Trend Indi for levels |
Dont ask, just do. Doesnt mean I will look into it, but there are enough coders here. |
|
| Author: | renexxxx [ Fri Feb 09, 2018 2:42 am ] |
| Post subject: | Trend Indi for levels |
Max, I have provided hereby some utility code in a script to help you work out the round number problem. The issue is this: When does price touch a round number? This needs to be defined in order to create code for it. One might say: price touches a round number, if the candle encompasses a round number between the LOW and the HIGH. The highest level of resolution of historical prices is on the M1 timeframe. So, we can iterate over the M1 candles starting at candle 0 and working our way back, to find two candles that encompass a round number. But what if a M1 candle encompasses two or more round numbers? This might not happen a lot, but it does happen. In that case we have no option to discard that candle. The attached code provides some snippets and the main function (getRoundNumberTrend) that you can use to your hearts content. Have fun. |
|
| Author: | McNish [ Fri Feb 09, 2018 1:47 pm ] |
| Post subject: | Trend Indi for levels |
Thanks Tomaso, Hello Rene, Yes, u are right about the issues you pointed out. I had to bang my head for the limited knowledge i have for coding. Then i wrote the logic down on paper and tried to find a starting point. The solution i developed works like this. I will start with a starting point, LookBackBars. Have locked it at 250. Also u r bang on about the timeframe & i too reached the same conclusion about the 1M TF. So i start at 250 bars behind the current bar on 1M TF. Of that bar, i take the close prie as the anchor price to start with. Taking that anchor price, i look for the fork of the price web, i,e next RN above and below anchor price. Then i start to see if price touched either of the fork prices by checking the high and low of the 1m on every subsequent bar. When that happens, initial trend is established & i reset the anchor point as the RN that was just touched. This is the initial iteration with break call. Next is the main iteration where the NewAnchorPrice derived from the RN just touched is taken as reference and New Forks of RN are derived and set. Also, this time, the lookback bars are re-set to the bar on which the price touched the RN Fork. So with the new Forks of RN and new value of LookBackBars, i go forward with the same excercise of looking if Low or High of subsquent bars touched either of fork of RN. And when that happens, trend is determined. Last night when i finished the code and put it on the chart, nothing happened and the chart froze. Today when i did the same, the trend arrow draws on the RHS of the chart but still the chart freezes. Thus am uploading the code here if you or others want to have a look at it and suggest edits. BTW, the code of finding the RN fork is not mine, rest everything else is. And the Mini Me that i am for code, i was quite delighted by myself that i could actually phantom the logic and put it in the form of code and complie without errors. Please suggest the edits required. Your guidance and assistance is always valuable to me, and am sure to many others as well. Cheers & Regards, Max, |
|
| Author: | heart1010 [ Thu Feb 15, 2018 10:06 am ] |
| Post subject: | Trend Indi for levels |
Thanks for that rennexxxx |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|