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

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > AmiBroker


Spot the code error in afl please.
Started:November 23rd, 2016 (01:47 AM) by milkysahai001 Views / Replies:225 / 14
Last Reply:November 24th, 2016 (10:51 AM) 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.

Old November 23rd, 2016, 01:47 AM   #1 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Stock Futures
 
Posts: 23 since Sep 2016
Thanks: 9 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
     

Old November 23rd, 2016, 03:19 PM   #2 (permalink)
Trading for Fun
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 76 since Oct 2014
Thanks: 0 given, 30 received

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

Reply With Quote
     

Old November 23rd, 2016, 11:41 PM   #3 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Stock Futures
 
Posts: 23 since Sep 2016
Thanks: 9 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
     

Old November 24th, 2016, 12:07 AM   #4 (permalink)
Elite Member
Toronto Canada
 
Futures Experience: Intermediate
Platform: ninjatrader
Favorite Futures: es
 
mmaker's Avatar
 
Posts: 338 since Feb 2011
Thanks: 1,146 given, 362 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
     

Old November 24th, 2016, 04:45 AM   #5 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Stock Futures
 
Posts: 23 since Sep 2016
Thanks: 9 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
     

Old November 24th, 2016, 06:17 AM   #6 (permalink)
Trading for Fun
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 76 since Oct 2014
Thanks: 0 given, 30 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:
     

Old November 24th, 2016, 06:30 AM   #7 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Stock Futures
 
Posts: 23 since Sep 2016
Thanks: 9 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
     

Old November 24th, 2016, 06:33 AM   #8 (permalink)
Trading for Fun
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 76 since Oct 2014
Thanks: 0 given, 30 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:
     

Old November 24th, 2016, 06:35 AM   #9 (permalink)
Trading for Fun
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 76 since Oct 2014
Thanks: 0 given, 30 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
     

Old November 24th, 2016, 06:49 AM   #10 (permalink)
Trading Apprentice
Agra+India
 
Futures Experience: Beginner
Platform: MultiCharts
Favorite Futures: Stock Futures
 
Posts: 23 since Sep 2016
Thanks: 9 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 > Futures Trading, News, Charts and Platforms > Platforms and Indicators > AmiBroker > 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)
 

NinjaTrader 8: Features and Enhancements, Tips and Tricks

Dec 6
 

Al Brooks: Stop Losing when a Good Trade goes Bad, Correcting Mistakes

Elite only
 

Trading Technologies: Algo Design Lab hands-on

Dec 13
     

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 06:07 AM.

Copyright © 2016 by futures.io. 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.
 
no new posts

Page generated 2016-12-06 in 0.12 seconds with 39 queries on phoenix via your IP 54.158.157.24