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

RE: [amibroker] changing bar colors



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Hi DT,
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>The easiest way would be to save the RSI() before modification and then 
calculate the percentage change between the two - this could be show as an 
indicator...it is quite interesting to see what happens if you set a change and 
then move it along the X-axis.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>take care,
<FONT face=Arial color=#0000ff 
size=2>herman
<FONT face=Arial color=#0000ff 
size=2> 
<FONT 
face=Arial>CursorBar   = SelectedValue<FONT 
color=#000000>(BarIndex()) 
== BarIndex<FONT 
face=Arial>(); ParamPrice = <FONT 
color=#0000ff>SelectedValue(<FONT 
color=#ff0000>Close) * (<FONT 
color=#ff00ff>1 + <FONT 
color=#ff00ff>0.01 *<FONT 
color=#0000ff>Param("Close 
% Change",0<FONT 
color=#000000>,-10<FONT 
color=#000000>,10<FONT 
color=#000000>,0.1<FONT 
size=2>)); RSIs = <FONT 
color=#0000ff>RSI(<FONT 
color=#ff00ff>4<FONT 
color=#000000>); Close<FONT 
color=#000000> = IIf<FONT 
color=#000000>(CursorBar,ParamPrice,<FONT 
color=#ff0000>Close<FONT 
face=Arial>); <FONT 
color=#0000ff>Plot(<FONT 
color=#ff0000>C,<FONT 
color=#ff00ff>"Close",<FONT 
color=#ff00ff>1,<FONT 
color=#ff00ff>64<FONT 
color=#000000>); Plot<FONT 
color=#000000>(RSI<FONT 
color=#000000>(4<FONT 
color=#000000>),"RSI(4)"<FONT 
color=#000000>,1<FONT 
color=#000000>,1<FONT 
color=#000000>|styleOwnScale<FONT 
color=#000000>,0<FONT 
color=#000000>,500<FONT 
size=2>); StoRSI4 = (<FONT 
color=#0000ff>RSI(<FONT 
color=#ff00ff>4)-<FONT 
color=#0000ff>HHV(<FONT 
color=#0000ff>RSI(<FONT 
color=#ff00ff>4),<FONT 
color=#ff00ff>4))/(<FONT 
color=#0000ff>HHV(<FONT 
color=#0000ff>RSI(<FONT 
color=#ff00ff>4),<FONT 
color=#ff00ff>4)-<FONT 
color=#0000ff>LLV(<FONT 
color=#0000ff>RSI(<FONT 
color=#ff00ff>4),<FONT 
color=#ff00ff>4))*<FONT 
color=#ff00ff>100<FONT 
color=#000000>; Plot<FONT 
color=#000000>(RSIs,"RSI(4)"<FONT 
color=#000000>,5<FONT 
color=#000000>,1<FONT 
color=#000000>|styleOwnScale<FONT 
color=#000000>|styleNoLabel<FONT 
color=#000000>,0<FONT 
color=#000000>,500<FONT 
size=2>); <FONT 
color=#0000ff>Plot(StoRSI4,<FONT 
color=#ff00ff>"StoRSI4",<FONT 
color=#ff00ff>1,<FONT 
color=#ff00ff>1|<FONT 
color=#ff0000>styleOwnScale|<FONT 
color=#ff0000>styleNoLabel,<FONT 
color=#ff00ff>0,<FONT 
color=#ff00ff>500<FONT 
color=#000000>); Plot<FONT 
color=#000000>((RSIs-RSI<FONT 
color=#000000>(4<FONT 
color=#000000>))/RSI<FONT 
color=#000000>(4<FONT 
color=#000000>)*100<FONT 
color=#000000>,"%Change"<FONT 
color=#000000>,4<FONT 
color=#000000>,1<FONT 
color=#000000>|styleOwnScale<FONT 
color=#000000>|styleNoLabel<FONT 
color=#000000>,-100<FONT 
color=#000000>,400<FONT 
size=2>); <FONT 
color=#ff0000>for(n=<FONT 
color=#ff00ff>0;n<=<FONT 
color=#ff00ff>100;n=n+<FONT 
color=#ff00ff>10) <FONT 
color=#0000ff>Plot(n,<FONT 
color=#ff00ff>"",<FONT 
color=#ff00ff>0,<FONT 
color=#ff00ff>1|<FONT 
color=#ff0000>styleOwnScale,<FONT 
color=#ff00ff>0,<FONT 
color=#ff00ff>500<FONT 
color=#000000>); GraphXSpace<FONT 
color=#000000> = 50<FONT 
color=#000000>; 

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: DIMITRIS TSOKAKIS 
  [mailto:TSOKAKIS@xxxxxxxxx]Sent: January 25, 2004 7:11 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
  Using Param() to analyze system 
  price-sensitivityHerman,It would be interesting 
  to calculate how many bars we need to absorb a 10% distortion of C [absorb 
  means distortion < 1% for example]. Unfortunately it also depends on 
  the initial RSI(4) value and the number is not the same for any 
  stock.It may takes 30 or 40 bars sometimes.Dimitris Tsokakis--- In 
  amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen" <psytek@xxxx> 
  wrote:> Thank you DT, for your explanation and demo. Shows that it 
  is best to> understand the indicators one is using :-)> 
  > have a great day!> herman.>   -----Original 
  Message----->   From: DIMITRIS TSOKAKIS 
  [mailto:TSOKAKIS@xxxx]>   Sent: January 25, 2004 4:38 
  PM>   To: amibroker@xxxxxxxxxxxxxxx>   
  Subject: [amibroker] Re: Using Param() to analyze system 
  price-sensitivity> > >   --- In 
  amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen" 
  <psytek@xxxx>>   wrote:>   > 
  Hello,>   >>   > It took TJ's help to 
  get this little gem going, it allows you to>   place 
  your>   > cursor anywhere on your chart and modify/vary, 
  using the Param(),>   the price>   > 
  bar at that position. This is very useful when evaluating 
  the>   response of>   > systems and 
  indicators.>   >>   > Note that the 
  modified price is only available to subsequent code>   in 
  the>   > same formula. If you want to test a system you 
  need to either paste>   the code>   > 
  ahead of your system's code or copy it into an include file. Or, 
  if>   you need>   > the change to apply 
  to many formulas, you could use the>   SaveParameter() 
  and>   > GetParameter() OSAKA functions I posted some 
  weeks ago to>   accomplish that.>   
  >>   > In system analysis you may find that in some 
  systems a small price>   change of>   
  > a few cents may make the difference between going Short or Long. 
  In>   > Indicator analysis you may find that the effect of 
  a price change>   last much>   > 
  longer than you thought. For example the code below shows that 
  a>   price>   > change may effect the 
  RSI(4) value as far away 20 bars away.>   
  >>   > have fun!>   > 
  herman.>   >>   > 
  CursorBar   = SelectedValue(BarIndex()) == 
  BarIndex();>   > ParamPrice = SelectedValue(Close) * (1 + 
  0.01 *Param("Close %>   > 
  Change",0,-10,10,0.1));>   > Close = 
  IIf(CursorBar,ParamPrice,Close);>   > 
  Plot(C,"Close",1,64);>   > 
  Plot(RSI(4),"RSI(3)",1,1|styleOwnScale,0,500);>   > 
  StoRSI4 = 
  (RSI(4)-HHV(RSI(4),4))/(HHV(RSI(4),4)-LLV(RSI(4),4))*100;>   
  > Plot(StoRSI4,"StoRSI4",1,1|styleOwnScale,0,500);>   > 
  for(n=0;n<=100;n=n+10) Plot>   
  (n,"",0,1|styleOwnScale|styleNoLabel,0,500);>   > 
  GraphXSpace = 50;> >   Herman,>   The 
  RSI uses EMA.>   [see varPER.txt in the Files 
  section]>   Due to the recursive EMA character, a step change 
  of C needs>   [theoretically] infinite number of bars to be 
  absorbed.>   [see <A 
  href="">http://www.amibroker.com/library/detail.php?id=116 
  ]>   In practical use you see a finite number of bars because 
  of the 2->   digit accuracy of your 
  results.>   If RSI was using MA, then the adaption time would 
  be finite.>   Try to change by 20% a Close value 50 bars ago 
  for MA> >   
  R1=MA(C,4);Plot(R1,"R1",1,1);>   L1=LastValue(Cum(1)); 
  D=50;>   Ic=C;>   
  percentage=20/100;>   
  C[L1-D]=(1+percentage)*Ic[L1-D];>   
  R2=MA(C,4);>   Plot(R2,"R2",4,1);>   The 
  distortion will disappear in 4 bars, no matter if you use>   
  percentage 20% or 50% or 100%.>   If you try now> 
  >   R1=EMA(C,4);Plot(R1,"R1",1,1);>   
  L1=LastValue(Cum(1)); D=50;>   Ic=C;>   
  percentage=20/100;>   
  C[L1-D]=(1+percentage)*Ic[L1-D];>   
  R2=EMA(C,4);>   Plot(R2,"R2",4,1);>   the 
  distortion will have much longer impact and it changes as 
  you>   change the percentage.>   Dimitris 
  Tsokakis> > > > > >   Send 
  BUG REPORTS to bugs@xxxx>   Send SUGGESTIONS to 
  suggest@xxxx>   
  ----------------------------------------->   Post 
  AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx>   (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)>   
  -------------------------------------------->   Check group 
  FAQ at:> <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html> 
  > > > 
  ----------------------------------------------------------------------------> 
  -->   Yahoo! Groups Links> 
  >     a.. To visit your group on the web, go 
  to:>     <A 
  href="">http://groups.yahoo.com/group/amibroker/> 
  >     b.. To unsubscribe from this group, send an 
  email to:>     
  amibroker-unsubscribe@xxxxxxxxxxxxxxx> >     
  c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
  Service.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: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  
  
  Yahoo! Groups Links
  
    To visit your group on the web, go to:<A 
    href="">http://groups.yahoo.com/group/amibroker/  

    To unsubscribe from this group, send an email to:<A 
    href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

    Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
  


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.