Amibroker formula coading help required

#1
Dear traders ,
i required help on afl coading for exitprice that is if i exit my position in multiple condition then in backtest report it showing close price of that candel.but i required exact price of what my condition. for example if my condition is cross(prevdayc,l) or (h < prevdayc) or (c < ma(period,c) ; position will exit when low crossing prevdayc actual exit price is prevdayc and like this other cond also.but backtest report will show close of the candel .how to correct this .
 
#2
Linsupertrend and PSA (Price Speed Acceleration)

I would like to know MS Excel formula for below mentioned indicators:

Linsupertrend

Factor=param("Factor",3,1,3,1);

Pd=Param("ATR Periods",10,1,100,1);


Up = LinearReg((H+L)*0.5,Pd) + Factor*ATR(Pd);
Dn = LinearReg((H+L)*0.5,Pd) - Factor*ATR(Pd);

iATR=ATR(Pd);

PSA (Price Speed Acceleration)

//---- indicator buffers

extern int period = 240;
extern bool show_speed = TRUE;

int limit;

double speed[];
double acceleration[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);

//---- drawing settings

if (show_speed == TRUE){

SetIndexStyle(0,DRAW_HISTOGRAM);

}else{

SetIndexStyle(0,DRAW_NONE);
}
SetIndexBuffer(0,speed);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,acceleration);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i;
//----

if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;

for(i=0; i<limit; i++) {
speed = iClose(Symbol(),0,i)-iClose(Symbol(),0,i+period);
}

for(i=0; i<limit; i++) {
acceleration = speed-speed[i+period];
}

//----
return(0);


I need help with above..
 

vijkris

Learner and Follower
#3
Dear traders ,
i required help on afl coading for exitprice that is if i exit my position in multiple condition then in backtest report it showing close price of that candel.but i required exact price of what my condition. for example if my condition is cross(prevdayc,l) or (h < prevdayc) or (c < ma(period,c) ; position will exit when low crossing prevdayc actual exit price is prevdayc and like this other cond also.but backtest report will show close of the candel .how to correct this .
This happens because in ur formula u did not mention sellprice/coverprice.
U just mentioned sell/cover.
The exit will happen according to ur condition but since sellprice is missing, it ll take close of the candle as exit price.
 
#4
Dear traders ,
i required help on afl coading for exitprice that is if i exit my position in multiple condition then in backtest report it showing close price of that candel.but i required exact price of what my condition. for example if my condition is cross(prevdayc,l) or (h < prevdayc) or (c < ma(period,c) ; position will exit when low crossing prevdayc actual exit price is prevdayc and like this other cond also.but backtest report will show close of the candel .how to correct this .
I am not sure if this can answer your question.. :)
http://www.marketcalls.in/afl-code/start-scanning-stocks-using-amibroker-exploration.html
 
#5
Amibroker afl coding help required

Whenever I press Explore button, I want this afl to display only 1 symbol in Automatic Analysis window out of watchlist. Something is missing there, please help me.. :)

wlnum = GetOption( "FilterIncludeWatchlist" );
List = CategoryGetSymbols( categoryWatchlist, wlnum ) ;

if ( Status("stocknum") == 0 )
{
StaticVarRemove( "rank*" );

for ( n = 0; ( Symbol = StrExtract( List, n ) ) != ""; n++ )
{
SetForeign ( symbol );
values = Roc( Close, 10 );
RestorePriceArrays();
StaticVarSet ( "valuesToSort" + symbol, values );
}

StaticVarGenerateRanks( "bot", "valuesToSort", -1, 1234 );
}

symbol = Name();

rank = StaticVarGet ( "rank" + "values" + symbol );

AddColumn ( rank, "AbsValues" );

Filter = rank <= 1;
 
Last edited:
#7
dear sir, how is amibroker software? how is its scanning and exploration facilities? I am seriously thinking to buy amibroker software and e signal data.

regards. buran,
 
#8
Amibroker is really good, I have used multiple charting softwares but the kind of flexibility and power you can get in Amibroker is Unique. It is also super fast and easy to code with tons of examples all around.

I have licenses Amibroker v 6.10 and I will certainly recommend Buying it as it is worth it. In terms of Data you dont need e-signal, there are many cheaper options available that provide tick data at around 500 Rs per segment per month. That works well with Amiboker.

Happy Trading.
Ganesh
 

ksesha

Active Member
#9
Friends, I am currently trading NIFTY using multiple strategies with Amibroker like EMA cross, RSI cross, 20 period Hi Lo breakout and OBV . For this I am opening a new chart window and inserting each indicator which show Buy, Sell signals. In a clear trend 4 positions from 4 chart windows tiled was easy to see and trade.

Now I want to do the same for 4 more stocks and opening 4 new windows for each one is very annoying and couldnt see the chart properly with 16 open windows.

Tried to put each one in different sheet and hoping that 4 windows will be sufficient. But it didnot work. Tried to insert panes in the same window and it is very cluttering .

Friends is there any way to see and trade multiple signals for the same symbol without opening so many chart windows?

Appreciate you help in advance.
 
#10
Friends, I am currently trading NIFTY using multiple strategies with Amibroker like EMA cross, RSI cross, 20 period Hi Lo breakout and OBV . For this I am opening a new chart window and inserting each indicator which show Buy, Sell signals. In a clear trend 4 positions from 4 chart windows tiled was easy to see and trade.

Now I want to do the same for 4 more stocks and opening 4 new windows for each one is very annoying and couldnt see the chart properly with 16 open windows.

Tried to put each one in different sheet and hoping that 4 windows will be sufficient. But it didnot work. Tried to insert panes in the same window and it is very cluttering .

Friends is there any way to see and trade multiple signals for the same symbol without opening so many chart windows?

Appreciate you help in advance.

i understand your requirement.
what you need is 4 different buy sell arrows in different colors in the same chart window. thats all.
This afl will help you. Use it in chart window.

If you don't know how to code, then write down your buy sell conditions here. I will modify the afl.