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

[amibroker] days since higher price



PureBytes Links

Trading Reference Links




<SPAN 
class=595243904-27072004>And I *know* I said, at that time, and quoted again 
below, that zeroing every indicator yourself requires recoding every indicator 
on every pane you want to do this with.
<SPAN 
class=595243904-27072004> 
<SPAN 
class=595243904-27072004>Can it be done? Of course, especially if there's one 
particular indicator set you're interested in exploring this way. 

<SPAN 
class=595243904-27072004> 
<SPAN 
class=595243904-27072004>Would a simple built-in 
blanking-of-N-bars-at-the-end-of-the-data feature be better? I think so, and 
thought so when I brought it up a while ago. That's all I was trying to 
say.
<SPAN 
class=595243904-27072004> 
<SPAN 
class=595243904-27072004>Dave
<BLOCKQUOTE dir=ltr 
>
  
  <SPAN 
  >I thought I also answered that you 
  just have to make the indicators Null as well
  <SPAN 
  > 
  <SPAN 
  >StochRsi= 
  IIf(<SPAN 
  >BarIndex()>(LB-RM),Z, <FONT 
  color=blue>EMA((<SPAN 
  >RSI(<SPAN 
  >8)-<SPAN 
  >LLV(<SPAN 
  >RSI(<SPAN 
  >8),<SPAN 
  >8))/(<SPAN 
  >HHV(<SPAN 
  >RSI(<SPAN 
  >8),<SPAN 
  >8)-<SPAN 
  >LLV(<SPAN 
  >RSI(<SPAN 
  >8),<SPAN 
  >8)),<SPAN 
  >3)*<SPAN 
  >100 );
  
  <SPAN 
  >Cheers,Graham<A 
  href="">http://e-wire.net.au/~eb_kavan/ 
  
  <SPAN 
  >-----Original 
  Message-----From: Dave 
  Merrill Sent: Monday, July 
  26, 2004 9:12 PMTo: 
  amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: RE: [amibroker] Training 
  mode.
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Thanks for 
  your reply Herman, but we've had this discussion before (:-). This is from my 
  6/27 reply to similar responses when I first posted about 
  this:
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >---------------
  
  <FONT face="Times New Roman" 
  size=2> 
  
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Thanks for 
  your reply Graham, but as I mentioned, I've tried that, and it has 
  problems.
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Try the more 
  complete setup below, with a couple of random indicators added. Everything's 
  fine with nothing blanked. Blank out one bar, and the price plot still looks 
  fine, but MACD and RSI spike to zero on the null price bars, causing them to 
  rescale, the MACD illegibly. Blank a few more bars, past a SAR cross, and 
  SAR does the same thing. 
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >For another 
  approach, comment out the BlankAll() line, and re-enable BlankAll2(), on the 
  next line. This shifts everything to the right, "off the page", and then back. 
  I tried this because that seemed very analgous to those bars really not 
  existing. Turns out that AB seems to treat them as missing data (makes sense), 
  and uses the existing last value for the missing bars. 
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Is there a 
  way to work around all this? Of course, blank the indicators too. But that 
  means you have to recode every indicator on any pane you want to do this 
  with.
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >I'd much 
  rather just drop in a single function to adjust the price bars, and have 
  everything just work. But setting things to null doesn't really do it. Any 
  other ideas on a good blanking mechanism?
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >What I'd 
  really like is a built in feature that handled this automatically, including 
  blanking BuyPrice, ShortPrice etc, and any new built in variables as they get 
  added.
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Clearer?
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Dave 
  Merrill
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >---------------
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >global gBI, 
  gBarsBlanked;
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >gBarsBlanked 
  = Param( "bars", 0, 100, 0, -1);gBI = BarIndex();
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >function 
  IsBlanked() { return gBI >= (BarCount - 
  gBarsBlanked);}function Blank(array) { x = IIf(IsBlanked(), 
  Null, array); return x;}function Blank2(array) { x = 
  Ref(Ref(array, -gBarsBlanked), gBarsBlanked); return 
  x;}function BlankAll() { O = Blank(O); H = Blank(H); L = 
  Blank(L); C = Blank(C);  Avg = Blank(Avg); V = 
  Blank(V);}function BlankAll2() { O = Blank2(O); H = 
  Blank2(H); L = Blank2(L); C = Blank2(C);  Avg = Blank2(Avg); V = 
  Blank2(V);}function OHLCTitle() { return 
    Interval(2) + " " + Date()  + " Open = " + 
  O  + ", High = " + H  + ", Low = " + 
  L  + ", Close";}
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >BlankAll();//BlankAll2();
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >GraphXSpace = 
  5;Plot(C, OHLCTitle(), colorDefault, styleCandle);Plot(V, "Volume", 
  colorBlue, styleHistogram+styleOwnScale, 0, LastValue(Highest(V)) * 
  2);//Plot(IIf(IsBlanked(), 1, 0), "", colorLightGrey, 
  styleArea+styleOwnScale+styleNoLabel, 0, .5);
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >m = MACD(); r 
  = RSI(); s = SAR();
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >Plot(m, 
  "MACD", colorBlue, styleOwnScale);Plot(r, "RSI", colorRed, 
  styleOwnScale);Plot(s, "SAR", colorYellow, 
  styleDots+styleNoLine);/*Plot(Blank(m), "MACD", colorBlue, 
  styleOwnScale);Plot(Blank(r), "RSI", colorRed, 
  styleOwnScale);Plot(Blank(s), "SAR", colorYellow, 
  styleDots+styleNoLine);*/
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Courier New" 
  color=blue size=2><SPAN 
  >---------------
  <BLOCKQUOTE 
  >
    
    <SPAN 
    >This removes bars 
    under param() control.herman
    <SPAN 
    >Z = <FONT 
    face="Lucida Console"><SPAN 
    >Null<FONT 
    face="Lucida Console"><SPAN 
    >;LB =<FONT 
    color=blue>LastValue(<FONT 
    color=blue>BarIndex());<SPAN 
    >O = <SPAN 
    >IIf(<SPAN 
    >BarIndex()>(LB-RM),Z,<SPAN 
    >O);<SPAN 
    >H = <SPAN 
    >IIf(<SPAN 
    >BarIndex()>(LB-RM),Z,<SPAN 
    >H);<SPAN 
    >L = <SPAN 
    >IIf(<SPAN 
    >BarIndex()>(LB-RM),Z,<SPAN 
    >L);<SPAN 
    >C = <SPAN 
    >IIf(<SPAN 
    >BarIndex()>(LB-RM),Z,<SPAN 
    >C);<FONT face="Lucida Console" 
    color=green>// 
    Just an example systemStochRsi=<SPAN 
    >EMA((<SPAN 
    >RSI(<SPAN 
    >8)-<SPAN 
    >LLV(<SPAN 
    >RSI(<SPAN 
    >8),<SPAN 
    >8))/(<SPAN 
    >HHV(<SPAN 
    >RSI(<SPAN 
    >8),<SPAN 
    >8)-<SPAN 
    >LLV(<SPAN 
    >RSI(<SPAN 
    >8),<SPAN 
    >8)),<SPAN 
    >3)*<SPAN 
    >100;<SPAN 
    >Buy=<SPAN 
    >Cross(<SPAN 
    >17,StochRsi) <SPAN 
    >AND <SPAN 
    >Ref(<SPAN 
    >MA(<SPAN 
    >C,<SPAN 
    >21),-<SPAN 
    >1) < <SPAN 
    >MA(<SPAN 
    >C,<SPAN 
    >21);;<SPAN 
    >Sell=<SPAN 
    >Cross(StochRsi,<SPAN 
    >83);<SPAN 
    >Short=<SPAN 
    >Cross(StochRsi,<SPAN 
    >83) <SPAN 
    >AND <SPAN 
    >Ref(<SPAN 
    >MA(<SPAN 
    >C,<SPAN 
    >21),-<SPAN 
    >1) > <SPAN 
    >MA(<SPAN 
    >C,<SPAN 
    >21);<SPAN 
    >Cover=<SPAN 
    >Cross(<SPAN 
    >17,StochRsi);<SPAN 
    >Plot(<SPAN 
    >C,<SPAN 
    >"Close",<SPAN 
    >2,<SPAN 
    >1);<SPAN 
    >PlotShapes(<SPAN 
    >IIf(<SPAN 
    >Buy,<SPAN 
    >shapeUpArrow,<SPAN 
    >IIf(<SPAN 
    >Short,<SPAN 
    >shapeDownArrow,<SPAN 
    >shapeNone)),<SPAN 
    >IIf(<SPAN 
    >Buy,<SPAN 
    >colorBrightGreen,<SPAN 
    >IIf(<SPAN 
    >Short,<SPAN 
    >colorRed,<SPAN 
    >colorBlack)));
    <FONT 
    face=Tahoma size=2><SPAN 
    >-----Original 
    Message-----From: Dave 
    MerrillSent: Monday, July 
    26, 2004 8:26 AMTo: 
    amibroker@xxxxxxxxxxxxxxx<SPAN 
    >Subject: RE: [amibroker] Training 
    mode.
    
      
      <FONT face="Courier New" 
      color=blue size=2><SPAN 
      >I've 
      asked for something similar myself, maybe with a slider or something to 
      control the number of bars blanked at the end, rather than only stepping 
      through one at a time. Besides training your mind, it's also useful for 
      evaluating the behavior of indicators that "guess" about the future, or 
      for other reasons change shape as more data becomes 
      available.
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face="Courier New" 
      color=blue size=2><SPAN 
      >The 
      closest I know of that you can do currently is to set all prices after a 
      certain bar to null. Some types of indicators do odd things right at the 
      transition point, so you may need to null them out too. For that reason, 
      you may have to recode this arrangement specifically for every pane, not 
      idea;. 
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face="Courier New" 
      color=blue size=2><SPAN 
      >It also 
      won't remove hand-drawn studies, much less put them back later. You might 
      be able to code up something that sets the color of studies to your 
      background color, maybe?
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face="Courier New" 
      color=blue size=2><SPAN 
      >It's 
      better than nothing, and AFIK, the best we can do without it being built 
      into AB, but I too hope Tomasz adds a feature like 
      this.
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face="Courier New" 
      color=blue size=2><SPAN 
      >Dave 
      Merrill
      <BLOCKQUOTE 
      >
        <FONT 
        face="Courier New" size=2>I would like to 
        set AB's data to a selected date back in time, <FONT 
        face="Courier New"><SPAN 
        ><FONT 
        face="Courier New">clear of all existing studies I might have drawn like 
        trendlines ect, but 
        trendlines and other studies are able to be drawn. 
        Then every time the space 
        bar is pressed a new days(weeks or tick) <FONT 
        face="Courier New">worth of data is added.<FONT 
        face="Courier New">The reason for this of cause is to test or practice 
        trading like backtesting 
        your idears and instinks in real time.  
        Is there currently a 
        way to do this?<FONT 
        face="Courier New">Downloading each days history is not a solution. To 
        time consuming.Any 
        idear?Thanks 
        <FONT 
        face="Courier New">Ant.


Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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.