You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Well, let's go over them step by step if you really want to get them right...
This is what you've attached....... This is after I've removed function init, deinit and comments to make it more clear...
Now, can you please describe what exactly this EA is trying to achieve? I have the idea from your code but I want to make sure what you're intending to achieve...
I repeat (see quite above),
trade trigger (buffer7[1] of the indicator) in the EA delivers wrong values. The buffer7 in indicator (see white line in chart and output listing) delivers correct values.
Conclusion/main question:
Why function "double sT_1 = iCustom(NULL,0,"Heiken Ashi and TK1",Nbr_Periods,Multiplier,7,1" delivers wrong values (see output listing)?
Oh, my bad. Ok I tested them. Notice this :
the debugging Print uses these block. changeTrend is your focus right?
Notice that both print debugging of your indicator happens inside this loop header, so it always print them starting from i=Bars and finishes at i=0
while on your EA, your alert debug prints not within any loop and always printing bar index 0 to 5 :This print values u see from your indicator only able to display few bars values from the oldest bar when new ticks arrive and rewrites them with new values all over again. Never reaching or displaying latest bar values you wanted to see, i.e. 0 to 5.
So you're comparing head's values to tail's values. Try comparing the EA alert values to values in DataWindow instead (hover your mouse over the latest bars). It matches. changeTrend values is 1.40 up to bar index 32 (I use H1). So iCustom calls them fine.
I use D1,
values in EA are unambiguously wrong!!!. See please the time information 9. - 11.11.2010 by print debugging in. There entry 1.42000000 is absent.
Position i=0 10.11.2010 and i=1 11.11.2010 must be 1.42000000
This is why I recommend you to re-read the documentation to have solid grasp of program flow.
You don't have clear program flow. Every buffer must be filled before you make decision on it. You can't make decision on iteration!
I can explain where you made your mistake exactly but that would mean re-writing it for you. Try to understand my last hint in bold. There's nothing wrong with iCustom. There's definitely something wrong with your program's logical flow.
I don't state, that function iCustom works wrong!
Clarification:
- Buffer7 is filled (mostly with 1.4, occasionally with trigger 1.38 or 1.42) in indicator correct in time. In EA per new bar I would like to find trade trigger from the buffer7. Where is decision on iteration?
- EA with tick easier indicator but with same program flow (see source code below) works full correct.
I don't expect that you re-writing my program. If you exactly know, where I made mistake. Then you should indicate the source of error. This is the forum aim.
All other is a bold statement without proof.
Thank you for help!!!
Oh, boy.... Ok, so you only wrote the EA, the SuperTrend was not written by you, correct? The problem lies in the iteration of SuperTrend.
Let me rephrase this : I can explain where you made your mistake exactly but that would mean re-writing it for you -- > means : To sort it out exactly would be to re-write the indicator.
It is recounting every bars on every tick. All other is a bold statement without proof. You're making me doin' it, aren't you :)
I'm not boy but girl.
I'm not understand your argumentation. The easier indicator (one step- exact the same SuperTrend, without Heiken Ashi-see source code above) works with the same EA correct.
Consequently: Why should I change interation of SuperTrend, if it works in the same EA correct?
Your sentence is wrong, not oldets but youngest (see above):
This print values u see from your indicator only able to display few bars values from the oldest bar when new ticks arrive and rewrites them with new values all over again.
mql7, It's like when someone says 'Oh, lord...' they don't call someone a lord. it's just an interjection. I'm not calling you a boy or anything.
I made the wrong assumption of you being the author of SuperTrend. So, obviously that was wrongly addressed, my bad.
I'm convinced you really needed this, so I will help you as best as I can. Just give me some time to finish off some work. I don't promise a quick response, but I'll help you sort this out.
No, the sentence is correct. When you have decrementing loop :
and inside that loop you print or do something that uses that decrementing index, you will start with index Bars, which is the oldest bars. and work your way down to the youngest bar indexed 0.
So the youngest bar never had a chance to get displayed at least on my observation.