AmiBroker formula Language

kkseal

Well-Known Member
Decent work Kuri. Only thing is BAV may not want all of those vertical lines but only the last one that satisfied the condition. This i guess can be done by combining your stuff with VALUEWHEN, LASTVALUE AND possibly BARINDEX for pinpointing the particular bar.

Now for a clarification of my own :-

Ami doesn't support default values for parameters of user-defined functions/procedures. That is to say the in-built MACD(fpd=12, spd=26) works, but an user-defined KMACD(fpd=12, spd=26) does not.

Is that right or am i missing something?

Regards,
Kalyan.
 

kkseal

Well-Known Member
Hi guys I am new to amibroker I want to filter through RSI which is less then 30 pl. help me
Filter = RSI() < 30; (code to be used in Auto Analysis)

RSI() will use a default period of 14. Any other period needs to be entered, like RSI(9) for 9 periods.

Regards,
Kalyan.
 

kkseal

Well-Known Member
thnx kalyan
can i combained with macd like macd crossover at 0 level and rsi < 30 vol >100000 pl. help me
Yes you can by ANDing the conditions like -
Cross(MACD(),0) AND (RSI() < 30) AND (V>100000) etc.

However you must think over the logic of the combinations you want to use - like the MACD 0 crossover (specially with the default 12,26 periods) is unlikely when RSI <30 and with ANDing you'll get a TRUE(1) value when ALL the specified conditions are true.

Sometimes you might want to use either-or like Cross(MACD(),0) OR (RSI() < 30). This will return TRUE(1) when either or both the conditions are true (and FALSE(0) when neither is true).

Also make use of the Ami AFL tutorials and Help files to learn more - like how you can add additional columns in your Exploration results using the ADDCOLUMN function.

Regards,
Kalyan.

P.S. If you have any problems with CROSS(MACD(),0) try the following instead
(MACD() > 0 AND REF(MACD(),-1) <=0)
 
..................

Ami doesn't support default values for parameters of user-defined functions/procedures. That is to say the in-built MACD(fpd=12, spd=26) works, but an user-defined KMACD(fpd=12, spd=26) does not.

Is that right or am i missing something?

Regards,
Kalyan.
I guess you can "DEFINE" that in function definition!

May be parameters could be set! I will get back with more info soon!
 

kkseal

Well-Known Member
I guess you can "DEFINE" that in function definition!

May be parameters could be set! I will get back with more info soon!
Don't bother Kuri This is no big deal. If there's no easy (& direct) way to do it then i'm not interested anyway. So don't waste your time over some convoluted, roundabout method. (I'll convert them to DLLs anyway, later)

Regards,
Kalyan.
 
Hi Sr Members
I need help to convert metatrader fromula in to AFL.It is about Marketprofile. Any lights or help in this will very help full and very much appreciated
Thx
Manoj
 
Ami doesn't support default values for parameters of user-defined functions/procedures. That is to say the in-built MACD(fpd=12, spd=26) works, but an user-defined KMACD(fpd=12, spd=26) does not.


This may help!

function KMACD(IP1,IP2)
{
if(IP1=null and IP2=null)
{IP1=____;
IP2=____;// default value here;
}
.................................
return result;
}

Hope this could help!
 

Similar threads