![]() |
|
| Discuss how to do this in AB ? at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi guys, I have been trying to work on my system and the problem I ... |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools |
| Sponsored Links |
|
#1
|
|||
|
|||
|
Hi guys, I have been trying to work on my system and the problem I face is that not all the indicators give a signal at the same time. So Stoch might have crossed a couple of days back but MACD only crossed its signal line today and ADX might cross tomorrow.
So in short how do I check if an indicator gave a positive signal in the last 7 days and another gave today and check for it in the BUY rule. thanx a lot. |
| Sponsored Links |
|
#2
|
|||
|
|||
|
if you are using AA, just increase you n last days to 7. Since your question is too newbie like, I assume you are new to AB, so I am not going into the AFL part.
|
|
#3
|
|||
|
|||
|
Quote:
You can use ValueWhen() clubbed together with DateNum() to achieve what you are looking for. This is not possible without an AFL. Praveen. |
|
#4
|
|||
|
|||
|
thanx for the replies guys. I am happy to do AFL coding, although not an expert.
I was wondering if I can use BarsSince ? like Code:
BUY = BarsSince(ADXBuy) <= 7; With ValueWhen() and DateNum() can you give a small example ? it will help me get on my way. thanx. |
|
#5
|
|||
|
|||
|
Quote:
Its much simpler than using ValueWhen and DateNum. What I thought was to use ValueWhen to get the last day we got the buy signal. And then compare it with DateNum of current day. As you can see, BarsSince provides this functionality at one shot. Praveen. |
|
#6
|
|||
|
|||
|
I would like to sort scans results by time. But Amibroker seems to sort them
by date only. Could someone let me know how to sort by time? |
|
#7
|
|||
|
|||
|
Quote:
and use "Sort" thanks |
|
#8
|
|||
|
|||
|
Quote:
For eg. if your Scan output is in the format: Ticker, Date, Trade,etc, use SetSortColumns(3); It takes the column number, the index of which starts from 1. Give negative number to mean descending order. ie SetSortColumns(-3); would sort the results, in this example, in datetime descending order. Praveen. |
|
#9
|
|||
|
|||
|
Swagat and Praveen
Thanks for the response. When i try to sort the scan results manually I am able to sort by clicking on the column header for all the other parameters like ticker, trade, price etc. When I try to sort the datetime column it automatically sorts by date only and fails to take time into account. This becomes painful when your are running intraday scans. Praveen as you said I would be able automate the scan process by using the setsortcolumn. But I also need the scan to be sorted datetime wise so that the last results are displayed on top. Is there a solution for this. Please suggest (My guess is the format of the datetime field must be properly set. How to do this? ) Thanks |
|
#10
|
|||
|
|||
|
Hi,
As I'd said SetSortColumns() solves your problem. It takes care of time too. Please refer to the screen shot attached. Note both the AA output, as well as the AFL at the background. Praveen. |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
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.