Help needed with Afl

Discuss Help needed with Afl at the Equities within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi , My first attempt at writing an Afl. I have tried to write an afl ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > THE MARKETS > Equities

Notices

Equities Discuss & analyse stock market news, views, trends and your favourite stocks here.


Reply
 
Thread Tools
Sponsored Links
  #1  
Old 21st August 2007, 01:40 AM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Help needed with Afl



Hi ,

My first attempt at writing an Afl.
I have tried to write an afl that will show an arrow when the highest high of last 5 bars is crossed and when the lowest low of last 5 bars is crossed.

This is based on 1 minute charts.
The code shows blan, its not plotting.
Where am I going wrong?

Please guide this new programmer


_SECTION_BEGIN("myfirstafl");
TimeFrameSet (in1Minute );
Buy = High > HHV(Close,-5);
PlotShapes(shapeUpArrow*Buy,colorGreen);
Sell = Low < LLV(Close,-5);
PlotShapes(shapeDownArrow*Sell,colorRed);
Short = Sell;
Cover = Buy;
_SECTION_END();
Reply With Quote
  #2  
Old 21st August 2007, 10:44 AM
Member
 
Join Date: May 2006
Location: Bangalore
Posts: 914
bvpraveen is on a distinguished road
Default Re: Help needed with Afl

Hi Ratan,

You should use the Cross() function, which gives you single point where it crossed. If you use High > HHV(), it will give true signal for all days, after your Buy signal, till that condition is met.

Secondly, pass positive numbers to HHV(). ie HHV(close, 5) to mean highest close since 5 days.

Thirdly, we needn't worry about the chart interval. ie 1min, 5min, EOD etc. TimeFrameSet() and TimeFrameRestore() is needed only when you want to plot one intervals signal on another interval chart.

To conclude, the correct code should be like this:
Buy = Cross(Close, HHV(High, 5)); // When the close takes out highest high of last 5 days.
Sell = Cross(Close, LLV(Low, 5));
No need for TimeFrameSet() in this case.

All the best,
Praveen.
Reply With Quote
  #3  
Old 21st August 2007, 10:50 AM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Re: Help needed with Afl

BvPraveen:

U know, you are a God send

Thanks buddy

Highest Regards.
Reply With Quote
  #4  
Old 21st August 2007, 10:52 AM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Re: Help needed with Afl

Can I trouble you some more?
Reply With Quote
  #5  
Old 21st August 2007, 12:03 PM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Re: Help needed with Afl

Dear Bvpraveen,
I have tried the below,
There seem to be 2 places where I am stuck.
First is that only sell arrows are shown,
and second, the signals are not proper.
I mean, the arrows seem random.....
Can u please help?


_SECTION_BEGIN("BVP");
Plot(C,"Close",colorBlack,styleBar|styleThick);
Buy = Cross(Close, HHV(High, 5)); // When the close takes out highest high of last 5 days.
PlotShapes(shapeUpArrow*Buy,colorGreen);
Sell = Cross(Close, LLV(Low, 5));
PlotShapes(shapeDownArrow*Sell,colorRed);
_SECTION_END();

Enclosed please see the chart. I have circled the point where I think i may be doing something wrong.
PS: I have made change to sell signal, I have changed it to cross of low of last 5 bars.
Also, without the change also, signals were not matching.
Hope you can help.
Attached Images
File Type: png forbvp.png (64.2 KB, 19 views)

Last edited by ratan jain; 21st August 2007 at 12:16 PM.
Reply With Quote
  #6  
Old 21st August 2007, 01:43 PM
Member
 
Join Date: Nov 2006
Posts: 1,367
kkseal is on a distinguished road
Default Re: Help needed with Afl

Use Sell = Cross(LLV(L,5), C)
Reply With Quote
  #7  
Old 21st August 2007, 02:12 PM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Re: Help needed with Afl

Kkseal,
Even that is not helping.

I dont have any signals
Attached Images
File Type: png forkkseal.png (76.1 KB, 7 views)
Reply With Quote
  #8  
Old 21st August 2007, 02:14 PM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Re: Help needed with Afl

BVPraveen!!!!!!!!!

Help me out

You are the AFL GURU on Traderji........

I need your support
Reply With Quote
  #9  
Old 21st August 2007, 02:22 PM
Member
 
Join Date: Nov 2006
Posts: 1,367
kkseal is on a distinguished road
Default Re: Help needed with Afl

Why did you erase the BUY part? Keep everything as it is in the BVP code Just change the SELL line (4th line after SECTION_BEGIN)

Regards,
Kalyan.
Reply With Quote
  #10  
Old 21st August 2007, 02:23 PM
Member
 
Join Date: Dec 2006
Posts: 879
ratan jain is on a distinguished road
Default Re: Help needed with Afl

Ok trying and will get back to u in 5 mins

Thanks
Reply With Quote
Sponsored Links


Reply

Bookmarks


Advertise Here


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads for: Help needed with Afl
Thread Thread Starter Forum Replies Last Post
Help Needed joy433 Equities 3 30th May 2007 06:09 PM
Help Needed kirancabral Brokers & Demat Matters 0 5th February 2007 11:04 PM
Help Needed devesh Equities 1 27th December 2006 11:54 AM
Help Needed gaj Equities 7 17th March 2006 06:25 PM


All times are GMT +5.5. The time now is 04:08 PM.

Indemnity, Disclaimer & Disclosure Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum Rules Disclaimer & Disclosure and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum.
Disclaimer: Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.
 


Copyright © 2001 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.MasterOfTrading.com