[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: Some basic questions



PureBytes Links

Trading Reference Links


Jayson,
 
Thanks for the response.
 
Let me put the problem in perspective. Maybe then you can understand what I need and tell me if it is possible with my rudimentary programming skills.
 
I am working on the MIDAS method.
 
The support/resistance lines are date specific i.e. launched from specific dates which are user selected by eye balling the chart.
 
I had written the code for this in MS which HarveyHP was kind enough to ammend for use with Amibroker. The code is appended below for your examination. 
MIDAS CODE FOR AB
 
/*   WinMidas   */eMonth = Param("Enter the Month - MM",1,1,12);eDate = Param("Enter the Date - DD",1,1,31);eYear = Param("Enter the Year - YYYY",<FONT color=#ff00ff
 size=2>2004,1980,2100);DateNo = (eYear - 1900) * 10000 + eMonth * 100 + eDate ;numdays = BarsSince(DateNum() == DateNo ) ;TP = ( H + L + C ) / 3 ;pvol = TP * V ;cumpv = Cum( pvol );cumvol = Cum<FONT
 size=2>( V ) ;basecumpv = ValueWhen( numdays == 1, Ref( Cumpv, -1 ), 1 ) ;basecumvol = ValueWhen( numdays == 1, Ref( Cumvol, -1 ), 1 ) ;sr1 = cumpv - basecumpv ;sr2 = Cumvol - basecumvol ;sr = sr1 / sr2 ;Plot(sr,""<FONT
 size=2>,colorRed,styleLine) ;Plot(C,"",colorBlack,styleBar) ;Title =  EncodeColor(colorDarkBlue) + FullName() + "   [" + Name() + "]   " +WriteVal(DateTime(),formatDateTime) +  "\n" +EncodeColor<FONT
 size=2>(colorBrown) + "WinMidas Support/Resistance";
====================================
 
Now as you can see it allows for only one launch of a S/R level.. This code needs to be ammended so, that several SR levels can be launched from differing dates.
 
I will appreciate your comments on the workability of what I am trying to do per se and also in context of programming skills necessary for undertaking this exercise.
 
Regards
 
 
Rakesh
Jayson <jcasavant@xxxxxxxxxxx> wrote:


Rakesh,
One way would be to make your indicator a function then call the function as many times as you wish in as many plot statements as you need. Here is an example of a function for the tillson indicator that was discussed at length by Dt a few weeks ago. Note the plot lines at the end of the code where Ti3 is called using different parameters....
 
Regards,Jayson 
 
//the Ti3 average
function T3(price,periods,s)
{
e1=EMA(price,periods);
e2=EMA(e1,Periods);
e3=EMA(e2,Periods);
e4=EMA(e3,Periods);
e5=EMA(e4,Periods);
e6=EMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
}
pd1=Param("Long",40,10,100,1);
pd2=Param("Short" ,10,5,50,1);
Plot(t3(C,pd1,.71),"T3 " +"("+WriteVal(pd1,1.0)+")",colorYellow,1|styleThick);
Plot(t3(C,pd2,.74),"T3" +"("+WriteVal(pd2,1.0)+")",colorBlue,1|styleThick);

-----Original Message-----From: Rakesh Sahgal [mailto:rakeshsahgal@xxxxxxxxx]Sent: Tuesday, April 13, 2004 10:50 PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Param Question
Group
 
Can someone please explain how I should go about plotting multiple instances of an indicator with differing parameters in the same chart pane?
 
In simple words lets say an oscillator of EMAs' of periodicities 3&10, 5&35 etc etc.The paremters are not predefined but are manually entered.
 
TIA
 
Rakesh
 
 


Do you Yahoo!?Yahoo! Tax Center - File online by April 15th Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to suggest@xxxxxxxxxxxxx-----------------------------------------Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
 href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
		Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th


Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.