![]() |
| 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 ... |
|
|||||||
| Notices |
| Equities Discuss & analyse stock market news, views, trends and your favourite stocks here. |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
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(); |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
BvPraveen:
U know, you are a God send Thanks buddy ![]() Highest Regards. |
|
#4
|
|||
|
|||
|
Can I trouble you some more?
|
|
#5
|
|||
|
|||
|
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. Last edited by ratan jain; 21st August 2007 at 12:16 PM. |
|
#6
|
|||
|
|||
|
Use Sell = Cross(LLV(L,5), C)
|
|
#7
|
|||
|
|||
|
Kkseal,
Even that is not helping. I dont have any signals ![]() |
|
#8
|
|||
|
|||
|
BVPraveen!!!!!!!!!
Help me out ![]() You are the AFL GURU on Traderji........ I need your support ![]() |
|
#9
|
|||
|
|||
|
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. |
|
#10
|
|||
|
|||
|
Ok trying and will get back to u in 5 mins
Thanks |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
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 |
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.