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 friends and seniors, help me This is an attempt (by a newbie) to draw ...


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

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #121  
Old 11th April 2007, 05:02 PM
Member
 
Join Date: Jan 2007
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
ashutosh.krsrivastava is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Hi friends and seniors,
help me
This is an attempt (by a newbie) to draw MACD.
I want title like:
MACD Plot for:500343(PUDUMJEE)Daily - 3/12/2007MACD:M(12,26) = 1.3, Signal:S(12, 26, 9) = 1.2, Hist: H = 2

for that, i have written some code:

Code:
_SECTION_BEGIN("MACD Plot Title");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat(EncodeColor(colorGold)+"MACD Plot for:" + EncodeColor(colorBlue)+"{{NAME}}" 
						+ EncodeColor(colorRed) + "(" + FullName() + ") "
						+ EncodeColor(colorBlue) + "- {{INTERVAL}} {{DATE}}"));
_SECTION_END();

_SECTION_BEGIN("Plot MACD");
MACDName = StrFormat("MACD: M(" + macdStr + ") = " + WriteVal(MACDInd, 1.3));
	Plot( MACDInd, MACDName, myColor, ParamStyle("Style"));
_SECTION_END();

_SECTION_BEGIN("Plot Signal");
	//SignalName = StrFormat("Sig(" + sigStr + ") = " + WriteVal(SigInd,1.3));
	Plot( SigInd , StrFormat("Sig(" + sigStr + ") = " + WriteVal(SigInd,1.3)), colorBlue, ParamStyle("Style"));
_SECTION_END();

_SECTION_BEGIN("Plot Histogram");
	HistName = StrFormat("H = " + WriteVal(HistInd,1.3));
	Plot( HistInd, HistName, myColor, styleHistogram  | styleOwnScale | styleThick , -scaleHist * 1.2, scaleHist * 1.2);
_SECTION_END();
The problem is that I am getting
Title as defined in _N(Title...) but other parts are not coming in the title.
Infact all the things are coming in the interpretation window.

I wanted nothing in the interpretation window but everything in the title:

And also how to clear the interpretation window? like cls for dos.

Where am i doing wrong??
pls help
regards,
ashutosh
Reply With Quote
Sponsored Links
  #122  
Old 11th April 2007, 05:12 PM
Moderator
 
Join Date: Jul 2005
Location: kuwait
Posts: 1,456
Blog Entries: 5
Thanks: 45
Thanked 549 Times in 102 Posts
karthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to all
Reputation: 629
Default Re: AmiBroker formula Language

Ashutosh

Try this...

Title = ("MACD Plot for " + Name()+" " + Date() +" "+Interval(2) +" "+ EncodeColor(colorLime)+",Open "+Open +" ,High "+H+" ,Low "+L+" ,Close "+C+" "+"{{VALUES}}");

regards

Karthik
Reply With Quote
  #123  
Old 11th April 2007, 11:26 PM
Member
 
Join Date: Jan 2007
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
ashutosh.krsrivastava is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Quote:
Originally Posted by karthikmarar View Post
Ashutosh

Try this...

Title = ("MACD Plot for " + Name()+" " + Date() +" "+Interval(2) +" "+ EncodeColor(colorLime)+",Open "+Open +" ,High "+H+" ,Low "+L+" ,Close "+C+" "+"{{VALUES}}");

regards

Karthik

Hey Karthik,
I tried your code. but again, i am unable to get what i want:

This is the Interpretation that is being printed on AB Interpretation window:

Code:
MACD_Histogram
Date: 4/5/2007

Daily
MACD Plot for MARUTI 4/5/2007 Daily,O:746 ,H:763.9 ,L:741 ,C:755.9 {{VALUES}}
MACD: M(12,26) = -23.258
Sig(12,26,9) = -21.091
H = -2.167
Review of MARUTI UDYOG LIMITED (MARUTI)
as of 4/5/2007

Current Statistics

Close:  755.900
Change:    9.950
MACD Value:  -23.258
Signal Line:  -21.091
The MACD can provide buy/sell indications in three ways, signal line crossovers, overbought/oversold conditions, and divergences.

Crossovers:

Currently the MACD is bearish since it is trading below its signal line.
The MACD crossed below its signal line 1 period(s) ago.
Since the MACD crossed its moving average, MARUTI's price has increased    1.334%
And has ranged from a high of 768.000 to a low of 741.000

Overbought/Oversold

The MACD is not in an Overbought/Oversold range.

Divergence

There have been no divergence signals within the last 5 periods.
The problem is with the bold part.
The {{VALUES}} PORTION.

In the chart (attached as attachment): The initial part is in black, which i want as gold (i guess encodecolor() will do)

But, the values of macd signal or hist is being printed twice, One in black and one in color(pls see the chart);

this is the code snippet resulting in the double values in the chart (....I think)
Code:
_SECTION_BEGIN("MACD Plot Title");
	SetChartOptions(0,chartShowArrows|chartShowDates);
/*_N(Title = StrFormat(EncodeColor(colorGold)+"MACD Plot for:" + EncodeColor(colorBlue)+"{{NAME}}" 
						+ EncodeColor(colorRed) + "(" + FullName() + ") "
						+ EncodeColor(colorBlue) + "- {{INTERVAL}} {{DATE}}"));
*/
Title = ("MACD Plot for " + Name()+" " + Date() +" "+Interval(2)
	+ ",O:" + O + " ,H:" + H + " ,L:" + L + " ,C:" + C + " " + "{{VALUES}}");
_SECTION_END();

_SECTION_BEGIN("Plot MACD");
	MACDName = StrFormat("MACD: M(" + macdStr + ") = " + WriteVal(MACDInd, 1.3));
	Plot( MACDInd, MACDName, myColor, ParamStyle("Style"));
_SECTION_END();
Only code for MACD indicator section is attached, other two sections are like identical.
regards
ashutosh
Attached Images
File Type: png macdPriceChart.png (14.1 KB, 120 views)
Reply With Quote
  #124  
Old 12th April 2007, 12:06 AM
Moderator
 
Join Date: Jul 2005
Location: kuwait
Posts: 1,456
Blog Entries: 5
Thanks: 45
Thanked 549 Times in 102 Posts
karthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to allkarthikmarar is a name known to all
Reputation: 629
Default Re: AmiBroker formula Language

Hi Ashutosh

You have duplicate sections almost doing the same thing .

Title = ("MACD Plot for " + Name()+" " + Date() +" "+Interval(2)
+ ",O:" + O + " ,H:" + H + " ,L:" + L + " ,C:" + C + " " + "{{VALUES}}");
_SECTION_END();

_SECTION_BEGIN("Plot MACD");
MACDName = StrFormat("MACD: M(" + macdStr + ") = " + WriteVal(MACDInd, 1.3));
Plot( MACDInd, MACDName, myColor, ParamStyle("Style"));
_SECTION_END();

Did you try using one of them only.

regards

Karthik
Reply With Quote
  #125  
Old 12th April 2007, 12:28 AM
Member
 
Join Date: Jan 2007
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
ashutosh.krsrivastava is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Quote:
Originally Posted by karthikmarar View Post
Hi Ashutosh

You have duplicate sections almost doing the same thing .

Title = ("MACD Plot for " + Name()+" " + Date() +" "+Interval(2)
+ ",O:" + O + " ,H:" + H + " ,L:" + L + " ,C:" + C + " " + "{{VALUES}}");
_SECTION_END();

_SECTION_BEGIN("Plot MACD");
MACDName = StrFormat("MACD: M(" + macdStr + ") = " + WriteVal(MACDInd, 1.3));
Plot( MACDInd, MACDName, myColor, ParamStyle("Style"));
_SECTION_END();

Did you try using one of them only.

regards

Karthik
Thanks Boss,
finally got it right. You were correct, I used one and got the result. You are the man.

thanks again karthik
regards
ashutosh
Reply With Quote
  #126  
Old 12th April 2007, 09:52 AM
Member
 
Join Date: Dec 2006
Posts: 1,135
Thanks: 123
Thanked 203 Times in 86 Posts
ratan jain has a spectacular aura aboutratan jain has a spectacular aura aboutratan jain has a spectacular aura about
Reputation: 230
Default Re: AmiBroker formula Language

you know what people, 10 years of looking at indicators, and have realised that pure price action is the way to make money.

follow price.....it keeps you objective.

Just my 2 cents....
Reply With Quote
  #127  
Old 12th April 2007, 10:45 AM
Member
 
Join Date: Jan 2007
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
ashutosh.krsrivastava is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Quote:
Originally Posted by ratan jain View Post
you know what people, 10 years of looking at indicators, and have realised that pure price action is the way to make money.

follow price.....it keeps you objective.

Just my 2 cents....
Hi,
Elaborate my friend. Price action? Need details as to how.. and how to follow price........

regards
Reply With Quote
  #128  
Old 18th April 2007, 09:51 AM
Member
 
Join Date: Jan 2007
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
ashutosh.krsrivastava is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Hi seniors,
i found a post in this forum by satya where he posted a program to calculate support resistance etc.
below is his post
Code:
Pivot, Support , Resistance Calculator 

--------------------------------------------------------------------------------

Friends,

just try this tool developed by me. It calculates automatically all the R3, R2, R1, Pivot , S1, S2, S3 points for the next day.

The input for this application is a flat file with stock quotes.
the zip files has 2 files

1. Pivot.exe the executable file you should run
2. stock.ini file, where you can store your favourite stocks(e.g infosys,hinlev,icici,wipro,satcom)

the names should match with the names in flat file.

let me know, if it works fine.
Satya
what i wanted is to plot the same using Amibroker AFL. is there any way to do it??
or else where can i find theory regarding the method to calculate R1, R2 etc..

regards
ashutosh
Reply With Quote
  #129  
Old 25th April 2007, 10:37 PM
Member
 
Join Date: Feb 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
mavirk is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

Quote:
Originally Posted by ashutosh.krsrivastava View Post
Hi seniors,
i found a post in this forum by satya where he posted a program to calculate support resistance etc.
below is his post
Code:
Pivot, Support , Resistance Calculator 

--------------------------------------------------------------------------------

Friends,

just try this tool developed by me. It calculates automatically all the R3, R2, R1, Pivot , S1, S2, S3 points for the next day.

The input for this application is a flat file with stock quotes.
the zip files has 2 files

1. Pivot.exe the executable file you should run
2. stock.ini file, where you can store your favourite stocks(e.g infosys,hinlev,icici,wipro,satcom)

the names should match with the names in flat file.

let me know, if it works fine.
Satya
what i wanted is to plot the same using Amibroker AFL. is there any way to do it??
or else where can i find theory regarding the method to calculate R1, R2 etc..

regards
ashutosh
There are a few Pivots related AFLS at the mother site (AB AFL Library). You will acheive total satisfaction there.
Reply With Quote
  #130  
Old 14th May 2007, 10:35 PM
Member
 
Join Date: Jan 2005
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
veepsmsn is on a distinguished road
Reputation: 20
Default Re: AmiBroker formula Language

AFL code for PIPE PATTERN wanted.
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 11:37 AM.

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