# amibroker

1. ### Position size afl help needed

The system I am testing opens random number of positions every day (Long only), and closes at the end of the day (yesterday bought 4 stocks, today bought 10 stocks, etc.). I am trying to allocate the same % of equity to each position, but since the number of positions is different every day I am...
2. ### AFL code - Trading on concrete calendar dates

Hello, I would like to test an idea on strategy that trades on specific dates during the year only. I have defined concrete list of dates and want to back test this strategy that will on particular date buy on open and sell on close equities from certain basket. Unfortunately I cannot put...
3. ### Distance between two points: code incorrect

Hello can someone please help me with this code. I'm trying to have a distance between two moving averages but I can't get it to work, any suggestions? ///For instance I want the difference in percent between myma1 and myma2 to be no more than 2%. MaxDistance= 0.02; // max percentage...

Hello programmers, I am a slow learner please forgive this amateur question. I hope you can please assist me or guide me please. All I am trying to do is make the PDI Range greater than MDI adx range for 10 bars or more before buy is executed. I just don't understand "barssince" or if its...
5. ### How get top 5 results while scanning in amibroker.

Hello all, How can we get results in scanning according to position score as back-testing uses position score to rank signals. as i am trying to do autotrading, and using alterif for signal trigger. but while scanning i am not able to filter the top 5 results according to postion score...
6. ### AFL CODE: simple downtrend, I am wrong! :(

Hello, I have tried to make just a simple downtrend: I tried to make 3 red bars, but its not working. If someone could please correct me, I know its an amateur question but i'm still learning. Buy= C< Ref(C,-1) AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) < Ref(C,-3);/// I thought this would...
7. ### Send orders from AMIBROKER to MT4

Hello everyone so nice to be apart of this community. I have searched far and wide and can't even find a post about this. I understand data can be extracted from mt4 to ami. But I would like to actually send orders from ami to mt4. I'm guessing I would need like a EA script of some sort...
8. ### script to delete blank/junk symbol

Hello Friends, My amibroker db has some obsoleted, blank and/or junk symbol included, I need to clean those things from the database. Please help me to do this TIA
9. ### Amibroker ""PLEASE correct me and help me!!

Hello hardworking people, I have read your forums , went though multiple sites and cannot find the simple answer i'm looking for, if you would please be kind and offer your assistance it would be most honourable. All I am trying to do is manipulate the program to show me a gapup with a...
10. ### Dealing with multiple time-frames in Amibroker for backtests.

Hi all, I want to generate the signal on an hourly bar , but the trailing stops should run on 1-minute bars since trailing stop on hourly bar wouldn't work in real time. Settings are as follows: Generate signal on hourly bars and trailing stop loss at 0.3% with no fixed target. I don't...
11. ### How to identify buy and sell signal

Hi All, I am new here, kindly help me to understand that how can we judge for fake buy and sell signal in Amibroker.
12. ### Help required - convert to Array Code

hi, I am new to amibroker but know a little bit about C++. I tried coding the following. Amibroker always encourages coding using Arrays and its efficient as well in performance as well as its elegant. I would like to know how to code the following using Arrays and kindly request experienced...
13. ### I m back

Hello friends, I have resumed trading after long gap (and losing lots of money 10 yrs back). In my second inning I am going to follow strategy and right sets of tools and technologies. Hope to make this one a profitable stint. My background is IT and data science in particular. I am very...
14. ### looking for a good exit strategy

Hello fellow traders, i have been a trader for a long time and i am creating a custom formula for myself in amibroker. i have been successful in creating a good entry strategy but i am looking for some suggestions from you guys for a good exit strategy as well. Reason is, the current exit...
15. ### AFL code help

I want to create an amibroker AFL code as per the below requirements. 1. The rectangle should automatically extend to the right side when drawn on the chart. 2. The rectangle should display the price values on the upper and lower line of the rectangle [Right Side extend]. 3...
16. ### AFL Renko Code

I would like an adaptable code with renko bars, that slows down before trend change and also shows time-line below it. PS: I know Renko is normally not time based.
17. ### Circular Reference thru StaticVarGet/Set.

Is Circular Reference possible in AFL ? Tried StaticVarGet & Set , got desired results along with a lot of garbage AND utterly UnReliable in Live Trade bcoz everytime Explore/Scan/Backtest Button Clicked --> the AFL gives Different results each time. Sample codes: 1.Basic Code...
18. ### help me edit code amibroker !!

I used to filter of amibroker with signal : Buy = Cross(MA,20) but it's delay 1 day. I want to filter signal BUY when MA = 20 and MA to cut from the bottom up, anyone help me edit code. Thank you verry much
19. ### Using the logic within a ranking column...

Dear readers, The 'addrankcolumn' function creates ranking columns which are one-based. Can the rank numbers within the ranking column be used for logic purpose ? If yes, is the name of the ranking column now the name of the array within a logic statement ? For example: rank(relative...
20. ### Missing buy/sell variable statements during backtest (amibroker)

While doing backtest of the following script in amibroker, I get 'missing buy/sell variable assignment' error, though I have assigned buy/sell variables in the script. **************************************************************** function isBuyCond() return (C[BarCount-2] >...