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

Re: [amibroker] modifying day()



PureBytes Links

Trading Reference Links




Don't 
know, but would it make any difference to use the new <SPAN 
class=328324000-04022004><FONT face=Arial color=#0000ff 
size=2>restorepricearrays() ?
just a 
thought

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Michael.S.G. 
  [mailto:OzFalcon@xxxxxxxx]Sent: Tuesday, February 03, 2004 5:35 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: Re: [amibroker] 
  Re: Variable scoping problem, I thinkFinal:I have 
  come to an explination:<FONT face="Courier New, Courier" 
  color=#008000>Reserved Arrays clober User arrayson any subsequent calls to 
  the same function.Here is some code to show as an 
  example:Filter =<FONT 
  face="Courier New, Courier" color=#ff00ff>1<FONT 
  face="Courier New, Courier">;<FONT face="Courier New, Courier" 
  color=#800000>function 
  Any(array, 
  period)        {        <FONT 
  face="Courier New, Courier" color=#800000>local<FONT 
  face="Courier New, Courier"> 
  LowValue;        <FONT 
  face="Courier New, Courier" color=#008000>//LowValue = LLV(array, 
  period);<FONT 
  face="Courier New, Courier">        <FONT 
  face="Courier New, Courier" color=#008000>//ret = (100 * (array - LowValue) / 
  (HHV(array, period) -LowValue));<FONT 
  face="Courier New, Courier">        }        Diff 
  = Signal<FONT 
  face="Courier New, Courier">(<FONT face="Courier New, Courier" 
  color=#ff00ff>12, <FONT 
  face="Courier New, Courier" color=#ff00ff>26<FONT 
  face="Courier New, Courier">, <FONT face="Courier New, Courier" 
  color=#ff00ff>9);StochDiff = 
  Any(Diff, 5<FONT 
  face="Courier New, Courier">);       <FONT 
  face="Courier New, Courier" color=#008000>// 1st call <FONT 
  face="Courier New, Courier">MyClose = Close;JunkIgnored = 
  Any(MyClose, <FONT face="Courier New, Courier" 
  color=#ff00ff>14<FONT 
  face="Courier New, Courier">); <FONT 
  face="Courier New, Courier" color=#008000>// 2nd call<FONT 
  face="Courier New, Courier">JunkIgnored2 = Any(O, <FONT 
  face="Courier New, Courier" color=#ff00ff>14<FONT 
  face="Courier New, Courier">);      <FONT 
  face="Courier New, Courier" color=#008000>// Reserved Array clobers User 
  array<FONT 
  face="Courier New, Courier">                                                                        <FONT 
  face="Courier New, Courier" color=#008000>// On any subsequent 
  calls.<FONT face="Courier New, Courier" 
  color=#0000ff>AddColumn<FONT 
  face="Courier New, Courier">(C,<FONT face="Courier New, Courier" 
  color=#ff00ff>"Close"<FONT 
  face="Courier New, Courier">);<FONT face="Courier New, Courier" 
  color=#0000ff>AddColumn<FONT 
  face="Courier New, Courier">(Diff,<FONT face="Courier New, Courier" 
  color=#ff00ff>"Diff",<FONT 
  face="Courier New, Courier" color=#ff00ff>1.4<FONT 
  face="Courier New, Courier">);<FONT face="Courier New, Courier" 
  color=#0000ff>AddColumn<FONT 
  face="Courier New, Courier">(MyClose,<FONT face="Courier New, Courier" 
  color=#ff00ff>"MyClose"); 
  // Ends up being Open. 
  (Clobered!)<FONT face="Courier New, Courier" 
  color=#0000ff>AddColumn<FONT 
  face="Courier New, Courier">(O,<FONT face="Courier New, Courier" 
  color=#ff00ff>"Open"<FONT 
  face="Courier New, Courier">);At 
  11:22 AM 4/02/2004, you wrote:
  EDIT EDIT EDITShould have 
    Read........>I think you may be on the RIGHT track in regards to 
    calling reserved 
    >variables.Michael.At 11:05 AM 
    4/02/2004, you wrote:>I think you may be on the wrong track in 
    regards to calling reserved >variables.>It looks like it's 
    holding some value........Not sure though.>>Try 
    this.>Filter =1;>function StochTransform(array, 
    period)>         
    {>         local 
    LowValue;>         LowValue = 
    LLV(array, period);>         
    return (100 * (array - LowValue) / (HHV(array, period) 
    -LowValue));>         
    }>>Diff = Signal(12, 26, 9);>//StochDiff = 
    StochTransform(Diff, 5);  // Calling this 1st....>JunkIgnored = 
    StochTransform(C, 14);    // CHANGES 
    Diff.>//JunkIgnored = StochTransform(Diff, 
    14);       // Calling after 
    Doesn't.>AddColumn(C,"Close");>AddColumn(Diff,"Diff",1,4);>>>>>>At 
    08:02 AM 4/02/2004, you wrote:>>Dave - just a quick reply 
    FYI.  I wasn't implying a stack overflow.>>My wildass guess 
    was that pointers to parm vectors were being passed>>on the stack 
    along with a result pointer, and that the call stack>>became 
    unbalanced and an input pointer was being used for a 
    result>>pointer.  Anyway, Tomasz will let us know, but it 
    looks like it is a>>problem.>>>>-- 
    Bruce>>>>>>--- In amibroker@xxxxxxxxxxxxxxx, 
    "Dave Merrill" <dmerrill@xxxx>>>wrote:>> > 
    Thanks for your further investigations, good work. Interesting 
    that>>it's>> > only direct uses of the reserved 
    variables that causes this.>>Besides your>> > stack 
    overflow idea, maybe there's an issue with how input>>parameters 
    are>> > handled. I'd think stack issues would affect any 
    repeated call to>>the>> > function, regardless of 
    what the input vars were, but of course I>>don't have>> 
    > much context for even guessing.>> >>> > I did 
    write Tomasz, haven't heard back, we'll see what he says.>> 
    >>> > Thanks again for checking, glad to know I'm not just 
    completely>>losing it>> > over here. I 
    think...>> >>>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.