Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Spot the code error in afl please.
Updated December 8, 2016
Top Posters
looks_one
prouser
with 7 posts (4 thanks)
looks_two
milkysahai001
with 6 posts (0 thanks)
looks_3
mmaker
with 4 posts (1 thanks)
looks_4
Big Mike
with 1 posts (0 thanks)
trending_up
4,376 views
thumb_up
5 thanks given
group
3 followers
forum
17 posts
attach_file
0 attachments
Spot the code error in afl please.
November 24th, 2016, 08:30 AM
Toronto Canada
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508
milkysahai001
I am trying to code signals based on my own indicator, but the indicators are overlapping throughout on the chart. The formula for them is totally different but the values are coming same. Also there is no problem in compiling the afl. Can somebody point out the error in my code?
Vclose = 0;
Vclose = (Om+Hm+Lm+Cm)/4;
Vopen = 0;
Value1 = IIf (Ref (vOpen, -1) > 0, Ref(vOpen, -1), vClose);
Vopen = ((value1) + smooth * ( vClose - value1));
the values of vClose and vOpen should not come the same.
Please consider that I am newbie in afl coding.
dunno if it matters but you seem to be referencing the previous bar as well.
So you need to tell the program not to execute until x bars have been processed.
And you are assigning a value of zero to Vopen so Vopen will never be greater than zero.
I would initialize it to "1" to get it started.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
November 24th, 2016, 08:37 AM
Toronto Canada
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508
prouser
You have 300 posts and are member since 2011 and you are still unable to look at the link at the top which is clearly showing to you that you are in AmiBroker discussion area?
Are you trolling?
Anyway with upper easy simple platform info are you still unable to use search engines? Really?
https://lmgtfy.app/?q=AmiBroker+AFL
That sounds like a shot. Is it? I wasn't looking for links and afl clues. I was looking for the answer.
hey, it was late at night. I was sitting in the dark, could barely see my keypad and i was just trying to help the guy/girl out.
i never heard of afl. and maybe i had and long forgotten about it. In fact when i had ami i am not sure if afl was around or not.
But i must not have liked it cuz i moved on to C#.
November 24th, 2016, 09:21 AM
Zurich/Switzerland
Posts: 79 since Oct 2014
mmaker
dunno if it matters but you seem to be referencing the previous bar as well.
So you need to tell the program not to execute until x bars have been processed.
And you are assigning a value of zero to Vopen so Vopen will never be greater than zero.
I would initialize it to "1" to get it started.
There is no initialization required. And as you might have noticed the solution has been given already. He is looking for Heikin Ashi. Several examples available on the Internet already (with or without looping).
November 24th, 2016, 09:22 AM
Zurich/Switzerland
Posts: 79 since Oct 2014
mmaker
That sounds like a shot. Is it?
We don't shoot here on the other side of the Atlantic.
mmaker
I wasn't looking for links and afl clues. I was looking for the answer.
Then it has been a lazy attempt looking for an answer. Don't you think?
mmaker
hey, it was late at night. I was sitting in the dark, could barely see my keypad and i was just trying to help the guy/girl out.
C'mon that's a pretty lame excuse. You can do better. Nevertheless I am not shooting at your attempt to help. Just saying.
mmaker
i never heard of afl. and maybe i had and long forgotten about it. In fact when i had ami i am not sure if afl was around or not.
But i must not have liked it cuz i moved on to C#.
Since you never heard of it your conclusion is not really making sense.
FYI, there always has been the ability to code in AFL, C/C++, NET, .. in AmiBroker. Many choices instead of just one.
Last but not least here is a "shot" you were looking for (?)... since you were coding until late at night I can tell you that you would have been finished hours before late at night if coding in AFL instead of C# and as such you could have given better help to OP at daylight . Result: doing more pleasing things late at night. At least that's how I do it and it's fun.
November 24th, 2016, 09:51 AM
Toronto Canada
Experience: Intermediate
Platform: ninjatrader
Trading: es
Frequency: Several times daily
Duration: Minutes
Posts: 400 since Feb 2011
Thanks Given: 1,178
Thanks Received: 508
prouser
We don't shoot here on the other side of the Atlantic.
Then it has been a lazy attempt looking for an answer. Don't you think?
C'mon that's a pretty lame excuse. You can do better. Nevertheless I am not shooting at your attempt to help. Just saying.
Since you never heard of it your conclusion is not really making sense.
FYI, there
always has been the ability to code in AFL, C/C++, NET, .. in AmiBroker. Many choices instead of just one.
Last but not least here is a "shot" you were looking for (?)... since you were coding until late at night I can tell you that you would have been finished
hours before late at night if coding in AFL instead of C# and as such you could have given better help to OP at
daylight . Result: doing more pleasing things late at night. At least that's how I do it and it's fun.
You are the first one to make it to my ignore list. Adios.
December 7th, 2016, 05:19 PM
Zurich/Switzerland
Posts: 79 since Oct 2014
Seems I have been spot on.
Anyway contrary to adios (== negativity) I'm saying cu later (== hope).
December 7th, 2016, 08:02 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,499 since Jun 2009
Thanks Given: 33,264
Thanks Received: 101,715
The user prouser has been banned for rude behavior. I fully expect him to create another duplicate account and come back, in violation of our rules, which he has no respect for.
Be on the lookout...
Sent using the NexusFi mobile app
December 7th, 2016, 11:14 PM
Agra+India
Posts: 42 since Sep 2016
Thanks Given: 17
Thanks Received: 3
prouser
You have 300 posts and are member since 2011 and you are still unable to look at the link at the top which is clearly showing to you that you are in AmiBroker discussion area?
Are you trolling?
Anyway with upper easy simple platform info are you still unable to use search engines? Really?
https://lmgtfy.app/?q=AmiBroker+AFL
Big Mike
The user prouser has been banned for rude behavior. I fully expect him to create another duplicate account and come back, in violation of our rules, which he has no respect for.
Be on the lookout...
Sent using the
NexusFi mobile app
Thanks Big Mike.
Last Updated on December 7, 2016