Newbie needs some Amibroker AFL help

Discuss Newbie needs some Amibroker AFL help at the Algo & Automated Trading within the; All - perhaps some kind soul could help me. I'm not great at programming. I ...

Go Back > METHODS & STRATEGIES > Algo & Automated Trading

Algo & Automated Trading Discuss algo & automated trading systems and methods here.

Thread Tools
Old 10th January 2017, 07:02 AM
Join Date: Jan 2017
Posts: 6
Thanks: 0
Thanked 1 Time in 1 Post
PoorBoy is on a distinguished road
Default Newbie needs some Amibroker AFL help

All - perhaps some kind soul could help me. I'm not great at programming. I use Amibroker and it's been hard getting help. I would like to have a system that trades the ES S & P mini futures intraday, planning to use 1 minute bars. Here is what I want to look at:

1) I want to backtest trade entry only on the 2nd or 3rd touch of the same new high or low of day, obviously when a higher high or lower low wasn't also hit. In other words, each touch of that new level would have to be the highest or lowest to that point. So if the ES traded up to 2140.25, HOD, then pulled back a couple of ticks, then went back up to 2140.25, that would be the 2nd touch, and would trigger a trade entry. I would backtest 2nd touch only, 3rd touch only, etc. You can comment scenarios and leave the one active, and I will backtest each one separately. Sometimes the system will trade in the direction of the new HOD/new LOD, and sometimes it will fade it for a few ticks, depending on values of some indicators.

2) One of the indicators will look at 4 ETF tickers to determine underlying strength/trend day up or trend day down. Perhaps user-defined function such as MktLeaders would simplify the entry rules. So I need to determine if they are up ON THE DAY over the previous days' close. I would like this to look at all 4 to see how many of these are up, and also how many are down, on the day. For example, I will backtest entry long when 2 of the 4 are up on the day, 3 are up, or all 4. Conversely, if X number of these 4 ETFs are down, a sell signal is created. For now I will simply call out these tickers A, AA, B, and C. I did get some suppost (please see below) but feel that it is not correct, as this is an intraday trading system. I look to see if those 4 ETFs are up on the day over the previous days' close. So don't we need a '-1' at the end of the 2nd half of the code? No telling when/if I will get response using standard channels so any help would be appreciated! I'm not even totally sure how to integrate that last line of code into the entry rules.


'you could check the condition for a list of symbols and sum up the values, e.g. like this:

cond1 = Foreign("symbol1", "C") > Foreign("symbol1", "O");
cond2 = Foreign("symbol2", "C") > Foreign("symbol2", "O");
cond3 = Foreign("symbol3", "C") > Foreign("symbol3", "O");
total = cond1 + cond2 + cond3;
condFilter = total == 3;///'



Reply With Quote


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: Newbie needs some Amibroker AFL help
Thread Thread Starter Forum Replies Last Post
Amibroker Newbie Dheeraj.Sood AmiBroker 5 11th October 2012 01:56 PM
Amibroker Newbie - assistance AFL to find close in th top 50% of days range sezza AmiBroker 0 7th February 2011 07:32 AM
Few newbie amibroker questions skanker AmiBroker 1 6th March 2010 09:20 AM
few quiries related to amibroker from a newbie majnnuu AmiBroker 2 12th August 2008 07:50 PM
NSE2AmiBroker v2.0 Directly Export EOD File to AmiBroker without starting AmiBroker taswsol Software 11 24th April 2008 02:00 PM

All times are GMT +5.5. The time now is 02:18 PM.

Indemnity, Disclaimer & Disclosure Notice:
By visiting you automatically indicate that you agree to our Forum Rules, Indemnity, Disclaimer & Disclosure Notice and General Content Disclaimer Notice and indemnify, its associates and related parties of all claims howsoever resulting from the usage of the forum/site.
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. You are recommended to make appropriate enquiries and seek appropriate advise before sending money, incurring any expenses, acting on recommendations or entering into any commitment in relation to any advertisement published here. does not vouch for any claims made by the advertisers of products and services. will not be held liable for any consequences in the event such claims are not honoured by the advertisers. will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of any information by anybody mentioned anywhere on this site.
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, cannot determine the accuracy or legality of any 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 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 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 Although we constantly delete all irrelevant content and/or SPAM, if you should 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 - , All rights reserved.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70