| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Coder challenge:Managing New Bars in Multipair/multiTF EA https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=813 |
Page 1 of 1 |
| Author: | dietcoke [ Thu Sep 13, 2012 7:40 am ] |
| Post subject: | Coder challenge:Managing New Bars in Multipair/multiTF EA |
I've written a function to flag a new bar on any timeframe. Code: Select all This causes problems when, for instance, I want the value of an indicator shifted to the bar just closed. Has anybody got any ideas on how this might be tweaked to be accurate for all pairs, or better still, been there and done that? |
|
| Author: | dietcoke [ Fri Sep 14, 2012 1:04 pm ] |
| Post subject: | Re: Coder challenge:Managing New Bars in Multipair/multiTF E |
I guess the question I need answering is: Given That I know the time at which a new bar should start on any timeframe. How can I know when the first tick of the new bar has been received on any given pair??? Could I use iBars. I heard it's not reliable. Looks like i forgot to post some other helper functions and globals the main function uses. Code: Select all |
|
| Author: | NeoTrader [ Fri Sep 14, 2012 1:48 pm ] |
| Post subject: | Re: Coder challenge:Managing New Bars in Multipair/multiTF E |
hi dietcoke, why you don't use it like a ordinary IsNewBar Function? eg. Code: Select all related to your tick problem...have you tried an external tick simulator like Empty4-ticker? This is a freeware tool that is linked also here on the forum...or search via google. I use it usually on weekends for testing...but theoretically it should also work in normal trading hours... also just an idea.. happy trading, NeoTrader - |
|
| Author: | dietcoke [ Mon Sep 24, 2012 5:40 pm ] |
| Post subject: | Re: Coder challenge:Managing New Bars in Multipair/multiTF E |
Thanks for the response neo. The problem is this, and I think it will have to be resolved in any multipair autotraders. If I'm using a single isnewBar variable to determine the start of a new bar. The plan is to calculate a bunch of indicators at the start of the new bar for all the pairs in the multipair group. Lets say I calculate an indicator based on a shift of 1, intending to perfom an action based on the closing indicator value of the last bar. What happens if one or more pairs in the group have not yet received a tick for the new bar????? I've seen some odd things with indicator value during testing of Forex Robot and I can only put it own to the fact that indictors which are being calculated at bar start are calculating with the wrong shift sometimes. I can only put this down to CT4 not recognising a new bar until there is a tick for that pair If that postulation is correct, it means you need a new bar flag for each pair. |
|
| Author: | NeoTrader [ Mon Sep 24, 2012 7:51 pm ] |
| Post subject: | Re: Coder challenge:Managing New Bars in Multipair/multiTF E |
hi dietcoke, ok... this would mean that you need an 2 dimensional array for all your pairs with the symbols in the 1st dimension and the barstatus per TF as the 2nd dimension. I think iBarShift could do the trick This should allow you to get the correct shift across all pairs. hope this helps... happy trading, NeoTrader - |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|