Spot the code error in afl please. - AmiBroker | futures.io
futures.io futures trading


Spot the code error in afl please.
Started: by milkysahai001 Views / Replies:456 / 17
Last Reply: Attachments:0

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

Spot the code error in afl please.

  #1 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts, AmiBroker
Favorite Futures: Stock Futures
 
Posts: 31 since Sep 2016
Thanks: 10 given, 1 received

Spot the code error in afl please.

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.

Reply With Quote
 
  #2 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 32 received

First of all your code is incomplete.
Secondly do you realize that you have assigned zero to Vopen and Vclose?

Reply With Quote
 
  #3 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts, AmiBroker
Favorite Futures: Stock Futures
 
Posts: 31 since Sep 2016
Thanks: 10 given, 1 received


Prouser,

Yes I know the code is incomplete. it is the part in which the error is.
I assigned zero to vOpen and vClose as it was asking to initialize them.

Reply With Quote
 
  #4 (permalink)
Elite Member
Toronto Canada
 
Futures Experience: Intermediate
Platform: ninjatrader
Favorite Futures: es
 
mmaker's Avatar
 
Posts: 343 since Feb 2011
Thanks: 1,150 given, 371 received

what the heck is afl

Answer
This post has been selected as an answer to the original posters question Answer


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.

i dont have a clue what afl is but i can tell you what is happening with your logic....

the then part of your if statement is never executed.
Only the else branch is executed.
Hence Value 1 always equals the close.
Therefore vClose - value1 equals zero in the last line.....
Therefore smooth * ( vClose - value1)); goes to zero and you are left with.....
Vopen = ((value1)
and since value 1 equals the close....denoted as vClose....
Vopen equals vClose

so what the heck is afl?


Look at your raw data going into this logic and walk thru your code with the raw data.

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts, AmiBroker
Favorite Futures: Stock Futures
 
Posts: 31 since Sep 2016
Thanks: 10 given, 1 received

Futures Edge on FIO

mmaker View Post
i dont have a clue what afl is but i can tell you what is happening with your logic....

the then part of your if statement is never executed.
Only the else branch is executed.
Hence Value 1 always equals the close.
Therefore vClose - value1 equals zero in the last line.....
Therefore smooth * ( vClose - value1)); goes to zero and you are left with.....
Vopen = ((value1)
and since value 1 equals the close....denoted as vClose....
Vopen equals vClose

so what the heck is afl?


Look at your raw data going into this logic and walk thru your code with the raw data.

mmaker,

afl is amibroker formula language, used for coding algorithm which can run in amibroker trading platform.
thanks for your input. i will trying doing what you suggested.

Reply With Quote
 
  #6 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 32 received


milkysahai001 View Post
Prouser,

Yes I know the code is incomplete. it is the part in which the error is.
I assigned zero to vOpen and vClose as it was asking to initialize them.

Are you trying to translate from a different language?
Are you trying to create Heikin Ashi?
You should provide more info on what you are trying to achieve because right now your code doesn't make much sense.

Reply With Quote
The following user says Thank You to prouser for this post:
 
  #7 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts, AmiBroker
Favorite Futures: Stock Futures
 
Posts: 31 since Sep 2016
Thanks: 10 given, 1 received


prouser View Post
Are you trying to translate from a different language?
Are you trying to create Heikin Ashi?
You should provide more info on what you are trying to achieve because right now your code doesn't make much sense.


Prouser,

Yes I am trying to create Heikin Ashi. for that i need to get the modified prices for which I am writing the mentioned afl. I coded it in easy language for multicharts but not able to go on with afl because of this glitch.

Reply With Quote
 
  #8 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 32 received


mmaker View Post
what the heck is afl
...
i dont have a clue what afl is
...
so what the heck is afl?

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?

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Are you trolling?

Anyway with upper easy simple platform info are you still unable to use search engines? Really?
https://lmgtfy.com/?q=AmiBroker+AFL


Last edited by prouser; November 24th, 2016 at 06:39 AM.
Reply With Quote
The following user says Thank You to prouser for this post:
 
  #9 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 32 received


milkysahai001 View Post
Prouser,

Yes I am trying to create Heikin Ashi. for that i need to get the modified prices for which I am writing the mentioned afl. I coded it in easy language for multicharts but not able to go on with afl because of this glitch.

There are Heikin Ashi AFLs on the Internet.

Reply With Quote
 
  #10 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts, AmiBroker
Favorite Futures: Stock Futures
 
Posts: 31 since Sep 2016
Thanks: 10 given, 1 received



prouser View Post
There are Heikin Ashi AFLs on the Internet.


Prouser,

I am looking for them. Thanks.

Reply With Quote

Reply



futures.io > > > > Spot the code error in afl please.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

Anthony Drager: Pulling the trigger with confidence

Elite only
 

Leo Murphy: The Art and Science of Technical Analysis

Elite only
 

FuturesTrader71: Ask Me Anything

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
AFL Error 61 Jacare AmiBroker 2 March 23rd, 2016 10:55 AM
Need afl venkatbabu AmiBroker 1 June 1st, 2014 11:27 AM
need Amibroker afl venkatbabu AmiBroker 2 May 29th, 2014 09:31 AM
joeHAOindicator fails to compile with error code cs0542 joemiller NinjaTrader Programming 2 May 27th, 2013 04:21 PM
Help with code error kashter NinjaTrader Programming 10 March 8th, 2011 12:16 PM


All times are GMT -4. The time now is 09:05 PM.

no new posts
Page generated 2017-01-23 in 0.18 seconds with 39 queries on phoenix via your IP 54.161.200.170