NexusFi: Find Your Edge


Home Menu

 





Spot the code error in afl please.


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one prouser with 7 posts (4 thanks)
    2. looks_two milkysahai001 with 6 posts (0 thanks)
    3. looks_3 mmaker with 4 posts (1 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 4,212 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 17 posts
    2. attach_file 0 attachments




 
Search this Thread

Spot the code error in afl please.

  #11 (permalink)
 
mmaker's Avatar
 mmaker 
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 View Post
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.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Increase in trading performance by 75%
The Elite Circle
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #12 (permalink)
 
mmaker's Avatar
 mmaker 
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 View Post
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#.

Visit my NexusFi Trade Journal Reply With Quote
  #13 (permalink)
 prouser 
Zurich/Switzerland
 
Posts: 79 since Oct 2014



mmaker View Post
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).

Reply With Quote
  #14 (permalink)
 prouser 
Zurich/Switzerland
 
Posts: 79 since Oct 2014


mmaker View Post
That sounds like a shot. Is it?

We don't shoot here on the other side of the Atlantic.


mmaker View Post
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 View Post
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 View Post
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.


Reply With Quote
  #15 (permalink)
 
mmaker's Avatar
 mmaker 
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 View Post
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.

Visit my NexusFi Trade Journal Reply With Quote
  #16 (permalink)
 prouser 
Zurich/Switzerland
 
Posts: 79 since Oct 2014

Seems I have been spot on.

Anyway contrary to adios (== negativity) I'm saying cu later (== hope).

Reply With Quote
  #17 (permalink)
 
Big Mike's Avatar
 Big Mike 
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,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599

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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #18 (permalink)
milkysahai001
Agra+India
 
Posts: 42 since Sep 2016
Thanks Given: 17
Thanks Received: 3


prouser View Post
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 View Post
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.

Reply With Quote




Last Updated on December 7, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts