Questions tagged [amibroker]

Amibroker is a financial software for portfolio-level system design, testing and validation. It has its own scripting language AFL.

75 questions
0
votes
1 answer

3Lower lows condition

My condition is to identify 3 lower lows. Once this condition is satisfied. I want to plot lines for the next 3 days with the below condition. Cond1: lower Low -(Lower low * 2%) Cond2: lower Low -(Lower low * 3%)
0
votes
1 answer

Is there a way in Amibroker backtest to specify buy price?

Is there a way to place buy order at a certain value? I am trying to buy at the break of previous day high on a 5 min tf: DayH = TimeFrameGetPrice("H", inDaily, -1); // yesterdays high DayL = TimeFrameGetPrice("L", inDaily, -1); // low DayC =…
TRST
  • 3
  • 3
0
votes
1 answer

Inside Bar coloring as long as inside the range of mother bar Amibroker AFL

n= -1; Color = IIf((High < Ref(High,n) & Low > Ref(Low,n)), colorRed , colorWhite); Plot( Close, "Colored Price", Color, styleBar ); Red arrow pointing bar is mother bar and blue arrow pointing white bar is inside bar within motherbar…
0
votes
1 answer

Using ShellExecute in Amibroker once on last candle

I am new to AFL programming. what I am trying to do is to launch a console program in my computer using ShellExecute in amibroker AFL to launch my console program with parameters, which in turn contains code expensive logic to place order to my…
0
votes
1 answer

Amibroker - How to update data for all DB symbols?

I made my own plugin for IBKR. How can I force the data refresh for all symbols in DB? I need fresh data before launching an analysis or other options who needs them. I can update only the actives symbols with: PostMessage(g_hAmiBrokerWnd,…
0
votes
0 answers

The DLL was successfully built but it is not working

I use the example Plugin.cpp from amibroker ADK. I make a directory 'ASCII' under the folder 'amibroker' and put all the data inside named *.AQI. But no data found in amibroker. Is there something I changed in function GetQuotesEx cause the…
0
votes
1 answer

Amibroker AFL first 15min candle High

I want to find high of the first 15 min candle. I am using the below code. bi = BarIndex(); arrayitem = SelectedValue(bi) -bi[0]; firstbarHigh = High[arrayitem ]; This code is giving me the CLOSE price for the 1st candle. I want High price of the…
Mavrick
  • 505
  • 1
  • 7
  • 27
0
votes
1 answer

Get BarsSince() for nth occurrence instead of 1st occurrence

The function BarsSince() will return number of bars (time periods) that have passed since ARRAY was true (or 1) for the 1st occurrence of the condition true. https://www.amibroker.com/guide/afl/barssince.html For example, I have an array like…
user3848207
  • 3,737
  • 17
  • 59
  • 104
0
votes
1 answer

Replace zeros of array with last non-zero value in Amibroker

I have an array that looks like this; arr_with_zeros = [1 0 0 2 0 0 3 0 0 6 0 0 8 0 0] I want to replace the zeros with the last non-zero value in the array. The new array should look like this; arr_non_zeros = [1 1 1 2 2 2 3 3 3 6 6 6 8 8 8] This…
user3848207
  • 3,737
  • 17
  • 59
  • 104
0
votes
1 answer

More elegant way to convert this function to return array instead of single value in Amibroker

I have the following function which returns a single value. function getVolumeHigh_excludeUpBars(period) { volume_exclude_up = IIf( ROC(CLOSE,1) < 0, Volume, 0); SELECTED_BAR = SelectedValue( BarIndex() ); …
user1315789
  • 3,069
  • 6
  • 18
  • 41
0
votes
1 answer

Amibroker Bollinger Band Breakout and future price

I have coded a Bollinger Band breakout strategy with an Index filter using Amibroker as: SetOption("MaxOpenPositions", 20); SetPositionSize(5, spsPercentOfEquity); Index = Foreign("$XAO", "C", True); IndexMA = MA(Index, 75); BollyTop = BBandTop(C,…
Dave Barker
  • 6,303
  • 2
  • 24
  • 25
0
votes
1 answer

Getting maximum of multiple arrays in amibroker

I am trying to get the maximum of 6 amibroker arrays A, B, C, D, E, F. Below is my code; maximum = Max(Max(A, B), Max(C, D) ); maximum = Max(Max(maximum, E), F); I find the code somewhat ugly. What are some other ways to code this? I am using…
user3848207
  • 3,737
  • 17
  • 59
  • 104
0
votes
1 answer

How to print the date of the bar x bars after the selected bar?

In the interpretation window I want to print the date of the bar that follows say 10 bars after the selected bar. Let's assume I have selected Monday, the third of September 2018. Then Amibroker should print "2018-09-17" (10 trading days later).…
Joe
  • 1,628
  • 3
  • 25
  • 39
0
votes
1 answer

How to set this array based on 2 other arrays in Amibroker?

I have these 2 arrays signal_arr and value_arr in Amibroker. From these 2 arrays, I want to output an array output_arr such that when signal_arr is 1, it will follow the value of value_arr. When signal_arr is 0, output_arr will retain the value of…
user3848207
  • 3,737
  • 17
  • 59
  • 104
0
votes
1 answer

How to make convert this long assignment statement into a function in Amibroker?

I have this long assignment statement in Amibroker. num_times_above = iif(Ref(CLOSE, -0)>Ref(CLOSE, -4) , 1, 0) + iif(Ref(CLOSE, -1)>Ref(CLOSE, -4), 1, 0) + iif(Ref(CLOSE, -2)>Ref(CLOSE, -4), 1, 0) …
user3848207
  • 3,737
  • 17
  • 59
  • 104