Traderji.com - Discussion forum for Stocks Commodities & Forex

AmiBroker formula Language

Discuss AmiBroker formula Language at the AmiBroker within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Hi I want technical analysis including buy and sell signals for INTRADAY for use in ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > TOOLS & RESOURCES > Software > AmiBroker

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #211  
Old 14th June 2008, 12:29 PM
Member
 
Join Date: Feb 2008
Posts: 73
Thanks: 0
Thanked 2 Times in 2 Posts
Bhulokeshwar is on a distinguished road
Reputation: 12
Default Re: AmiBroker formula Language

Hi
I want technical analysis including buy and sell signals for INTRADAY for use in MCX,NCDEX and NSE.
1.Is AM supports for intraday,if so which version (i means standerd or proffesional ), i have to download from website ?
2.which one i have to use to data tranfer from odin diet karvy and sharekhan trade tiger
kindly help me please
Bhulokeshwar
Reply With Quote
  #212  
Old 27th June 2008, 05:14 AM
Member
 
Join Date: Sep 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
SRJC is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Quote:
Originally Posted by SRJC View Post
HI
The following is HEIKEN ASHI Afl.

////////////////////////////////////
//
// Heikin_Ashi For Amibroker
//
////////////////////////////////////

SetChartBkColor(ParamColor("Outer panel color ",colorPaleBlue)); // color of outer border

SetChartBkGradientFill( ParamColor("Inner panel color upper half", colorPaleBlue),ParamColor("Inner panel color lower half",

colorPaleBlue)); // color of inner panel

HaClose =EMA((O+H+L+C)/4,3);

HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );

HaHigh = Max( H, Max( HaClose, HaOpen ) );

HaLow = Min( L, Min( HaClose, HaOpen ) );

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), colorBlue, styleCandle | styleNoLabel );

Title = "\n" + "" + Name() + ", " + Interval(2) + ", " + Date() + "\n";

Can senior members provide color coding for the same: like Blue for hollow candles with upper shadows, Red for filled candles with lower shadows and diffrent color for body with lower and upper shadows?

If the information is already available, can you provide a link to it.

Kindly also add Buy and sell signals with arrows and prices.

SRJC
Hi

Can some senior members help me with the above?

SRJC
Reply With Quote
  #213  
Old 5th July 2008, 03:13 PM
Member
 
Join Date: Mar 2008
Posts: 84
Thanks: 141
Thanked 15 Times in 6 Posts
dhakkan is on a distinguished road
Reputation: 31
Default Re: AmiBroker formula Language

Hi SRJC,

In case I have understood it correctly.... just replace the following line

Quote:
Originally Posted by SRJC View Post
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), colorBlue, styleCandle | styleNoLabel );
by

Quote:
barColor = IIf(HaClose > HaOpen AND HaHigh > HaClose AND HaLow < HaOpen, ParamColor("Up with both wick, Color",colorBlue),
IIf(HaClose < HaOpen AND HaLow < HaClose AND HaHigh > HaOpen, ParamColor("Down with both wick, Color",colorViolet),
IIf(HaClose < HaOpen AND HaLow < HaClose, ParamColor("Down Color",colorRed),
IIf(HaClose > HaOpen AND HaHigh > HaClose , ParamColor("Up Color",colorGreen), colorWhite))));

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), barColor, styleCandle | styleNoLabel );
I can help you with the Buy and sell Signal... but you need to tell me the exact condition when to buy and when to sell.

take care.

Posting the changed AFL also..
///////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("HA");
////////////////////////////////////
//
// Heikin_Ashi For Amibroker
//
////////////////////////////////////

SetChartBkColor(ParamColor("Outer panel color ",colorPaleBlue)); // color of outer border

SetChartBkGradientFill( ParamColor("Inner panel color upper half", colorPaleBlue),ParamColor("Inner panel color lower half", colorPaleBlue)); // color of inner panel

HaClose =EMA((O+H+L+C)/4,3);

HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );

HaHigh = Max( H, Max( HaClose, HaOpen ) );

HaLow = Min( L, Min( HaClose, HaOpen ) );


barColor = IIf(HaClose > HaOpen AND HaHigh > HaClose AND HaLow < HaOpen, ParamColor("Up with both wick, Color",colorBlue),
IIf(HaClose < HaOpen AND HaLow < HaClose AND HaHigh > HaOpen, ParamColor("Down with both wick, Color",colorViolet),
IIf(HaClose < HaOpen AND HaLow < HaClose, ParamColor("Down Color",colorRed),
IIf(HaClose > HaOpen AND HaHigh > HaClose , ParamColor("Up Color",colorGreen), colorWhite))));

PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Modified " + Name(), barColor, styleCandle | styleNoLabel );

Title = "\n" + "" + Name() + ", " + Interval(2) + ", " + Date() + "\n";
_SECTION_END();
Reply With Quote
  #214  
Old 8th July 2008, 05:46 AM
Member
 
Join Date: Sep 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
SRJC is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

HI dhakkan

Thank you very much. Your thoughtful coding of 'up bar with both wick' and 'down bar with both wick' had ensured the continuity of price and as such eliminated the need for price arrows.

Once again a special Thank You for your cooperation.

SRJC

Last edited by SRJC; 8th July 2008 at 05:57 AM.
Reply With Quote
  #215  
Old 18th July 2008, 09:04 PM
Member
 
Join Date: Oct 2005
Location: Kolkata
Posts: 73
Thanks: 5
Thanked 0 Times in 0 Posts
sdebu_2000 is on a distinguished road
Reputation: 25
Default Timeframe set and TimeFrameGetPrice Function

Difference Between Timeframe set and TimeFrameGetPrice Function
Hi all ,
I am trying to put hourly Ema in 15min Chart but I cant understand which one should be used.

I wrote 2 codes:
1.


EMAstyle=ParamStyle("MAType",styleLine,maskAll );
EMAperiod=Param("MA Period",13,10,500);
ChartStyl=ParamStyle("Chart Type", styleCandle,maskAll );
Chartcolor=ParamColor("Chart Colour",colorBlack);


C_hrly=TimeFrameGetPrice("C",inHourly,0);
splema=EMA(C_hrly,EMAperiod);

Plot(splema,"Hourly EMA of "+EMAperiod+" Bar",colorBlue,EMAstyle);



2.

EMAstyle=ParamStyle("MAType",styleLine,maskAll );
EMAperiod=Param("MA Period",13,10,500);
ChartStyl=ParamStyle("Chart Type", styleCandle,maskAll );
Chartcolor=ParamColor("Chart Colour",colorBlack);

TimeFrameSet(inHourly);

HourlyEMA=EMA(C,EMAperiod);

TimeFrameRestore();
Plot(TimeFrameExpand(HourlyEMA,inHourly),"Hourly EMA",colorPink);




The problem is that, two ema values are different.
Please tell me which one can be used as actual hourly ema?

I ploted a normal ema by using Drag drop from average list in the amibroker.
after converting the chart into hourly mode , above two codes show same value but they are diff from the normal ema.
If any one of the above two codes results hourly ema then atleast 2 ema should be same after converting the chart into hourly mode.
Please Help. I am very much puzzled.
regards
Debdulal Bhattacharyya
Reply With Quote
  #216  
Old 28th July 2008, 10:14 PM
Member
 
Join Date: Jun 2007
Location: Mumbai
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
vchoksy is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Hi senior members and experts. I'm new to Amibroker and the AFL language is a bit daunting to me. I was wondering if any of you fine gentlemen or women - as the case may be - might be able to help me out here.

I'm trying to combine two or more afl formulas to generate a single exploration. Firstly : Is it possible?
If at all possible, how does one go about making a single afl file that can have many variables in it?

I mean, I can find different afls for all of the scans, but I would like to combine them into one. I can manage with a little bit of programming, so a little nudge from the experts ought to do it. Oh! and I'm sorry if this is a repeat query.

Looking forward to your expertise and assistance

VC
Reply With Quote
  #217  
Old 28th July 2008, 10:52 PM
Member
 
Join Date: Jul 2005
Posts: 444
Thanks: 36
Thanked 45 Times in 27 Posts
kenneth will become famous soon enough
Reputation: 75
Default Re: AmiBroker formula Language

Yes you can. Just copy the AFL's under the one you need the plot. Add the columns you need the exploration result with their formule. Alternatively you can give buy1, buy2...and display under different columns.

Explore and see the result.

Regards
ken
Reply With Quote
  #218  
Old 13th August 2008, 10:15 AM
Member
 
Join Date: Sep 2005
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
SRJC is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

HI dhakkan

The following is the


Trailing Stop - ATR Chandelier Exit v2.0 in MetaStock formet from trader on line.
>>>>>>>>pds:=Input("ATR periods",1,252,10);
pds1:=Input("ATR lookback periods",1,252,21);
multi:=Input("ATR multiplier",0,10,2.5);
plot:=Input("plot: trailing stop=1, Long+Short=2, signals=3",1,3,1);
adv:=Input("plot: today's trailing stop=0, tomorrow's stop=1",0,1,0);
delay:=Input("Entry and Exit signal delay",
0,5,0);
StLong:=HHV(C-multi*ATR(pds),pds1);
StShort:=LLV(C+multi*ATR(pds),pds1);
stopLong:=If(C<PREV,StLong,Max(StLong,PREV));
stopShort:=If(C>PREV,StShort,Min(StShort,PREV));
In:=Cross(C,Ref(stopShort,-1));
Out:=Cross(Ref(stopLong,-1),C);
Init:=Cum(In+Out>-1)=1;
InInit:=Cum(In)=1;
flag:=BarsSince(Init OR In)
< BarsSince(Init OR Out)+InInit;
signals:=Ref((InInit AND Alert(InInit=0,2)
OR flag AND Alert(flag=0,2))
-(flag=0 AND Alert(flag,2)),-delay);
stop:=Ref(If(flag=1,stopLong,stopShort),-1+adv);
If(plot=1,stop,
If(plot=2,Ref(stopLong,-1+adv),0));
If(plot=1,stop,
If(plot=2,Ref(stopShort,-1+adv),signals))<<<<<<<<<<<<
Can you please get it converted into AB AFL with Buy/Sell Signals, crossing the closing price?

There are about a dozen “trailing stop loss” indicators in the above portal and this is the best indicator.

Thanks in advance

SRJC
Reply With Quote
  #219  
Old 14th August 2008, 01:28 PM
Member
 
Join Date: Mar 2008
Posts: 84
Thanks: 141
Thanked 15 Times in 6 Posts
dhakkan is on a distinguished road
Reputation: 31
Default Re: AmiBroker formula Language

Quote:
Originally Posted by SRJC View Post
HI dhakkan

The following is the


Trailing Stop - ATR Chandelier Exit v2.0 in MetaStock formet from trader on line.
>>>>>>>>pds:=Input("ATR periods",1,252,10);
pds1:=Input("ATR lookback periods",1,252,21);
multi:=Input("ATR multiplier",0,10,2.5);
plot:=Input("plot: trailing stop=1, Long+Short=2, signals=3",1,3,1);
adv:=Input("plot: today's trailing stop=0, tomorrow's stop=1",0,1,0);
delay:=Input("Entry and Exit signal delay",
0,5,0);
StLong:=HHV(C-multi*ATR(pds),pds1);
StShort:=LLV(C+multi*ATR(pds),pds1);
stopLong:=If(C<PREV,StLong,Max(StLong,PREV));
stopShort:=If(C>PREV,StShort,Min(StShort,PREV));
In:=Cross(C,Ref(stopShort,-1));
Out:=Cross(Ref(stopLong,-1),C);
Init:=Cum(In+Out>-1)=1;
InInit:=Cum(In)=1;
flag:=BarsSince(Init OR In)
< BarsSince(Init OR Out)+InInit;
signals:=Ref((InInit AND Alert(InInit=0,2)
OR flag AND Alert(flag=0,2))
-(flag=0 AND Alert(flag,2)),-delay);
stop:=Ref(If(flag=1,stopLong,stopShort),-1+adv);
If(plot=1,stop,
If(plot=2,Ref(stopLong,-1+adv),0));
If(plot=1,stop,
If(plot=2,Ref(stopShort,-1+adv),signals))<<<<<<<<<<<<
Can you please get it converted into AB AFL with Buy/Sell Signals, crossing the closing price?

There are about a dozen “trailing stop loss” indicators in the above portal and this is the best indicator.

Thanks in advance

SRJC
Hi SRJC ... pm me your mail-id, yah00 will be better.
Reply With Quote
  #220  
Old 15th August 2008, 01:43 AM
Member
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kjetim is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Buy, sell, cover and short signal

Hi

I am trying to learn the AFL formula language, but have a problem.

Scenario: If I am using the indicator RSI=14 in a chart. The indicator will follow the market up and down. I want to buy when the indicator turns up and sell when the indicator turns down.
(Have seen ONE afl thar have nerby the same that i am asking for. Link: http://www.amibroker.com/library/detail.php?id=219)

Alternative 1:
I want to made a system that buy when the the RSI indicator turns up and sell when the RSI indicator turns down .


Alternative 2:
I want to made a system that buy and cover a short when the the RSI indicator turns up and sell and short when the RSI indicator turns down .

Can someone help me whis this??

Is there any formula that says BUY (whengoup) or SELL (whengodown) ??
Reply With Quote
Sponsored Links

Reply

Bookmarks


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: AmiBroker formula Language
Thread Thread Starter Forum Replies Last Post
need help on formula cmlee MetaStock 23 8th October 2007 07:55 PM
Metastock ,Metatrader & Amibroker indicator formula saji oommen MetaStock 0 4th June 2006 06:35 PM
Metastock language help Ropewalker MetaStock 4 1st November 2005 09:16 PM
TradeStation & MetaStock Formula Language bikertrader MetaStock 4 10th December 2004 01:50 PM


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

Indemnity, Disclaimer & Disclosure Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum Rules Disclaimer & Disclosure and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum.
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. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
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, Traderji.com cannot determine the accuracy of 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 Traderji.com 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 Traderji.com. 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 Traderji.com. If you 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 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.MasterOfTrading.com