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

RE: [EquisMetaStock Group] v8 System Tester Issues and how to fix. (for SR)



PureBytes Links

Trading Reference Links




The 
original post mentioned that Spryos already had the #include in his code (see 
below), so I didn't repeat that bit.   His (original) problem was more 
to do with version number than a syntax problem.   He would need a 
fairly recent beta (4.33?) to be able to use functions this 
way.    Since he mentioned that he is a demo user, he is unlikely 
to be using a beta version.
<FONT face=Arial color=#0000ff 
size=2> 
 
<BLOCKQUOTE 
>
  <FONT face="Times New Roman" 
  size=2>-----Original Message-----From: CS 
  [mailto:res1wgwl@xxxxxxxxxxx]Sent: Thursday, May 15, 2003 9:27 
  PMTo: equismetastock@xxxxxxxxxxxxxxxSubject: Re: 
  [EquisMetaStock Group] v8 System Tester Issues and how to fix. (for 
  SR)
  So what part do you disagree with?
  You used #include in the 
  formula that called it, right?
   
  Without #include it won't work 
  on my machine. 
   
  -CS
  <BLOCKQUOTE 
  >
    ----- Original Message ----- 
    <DIV 
    >From: 
    Anthony 
    Faragasso 
    To: <A 
    title=equismetastock@xxxxxxxxxxxxxxx 
    href="">equismetastock@xxxxxxxxxxxxxxx 
    
    Sent: Thursday, May 15, 2003 5:42 
    PM
    Subject: Re: [EquisMetaStock Group] v8 
    System Tester Issues and how to fix. (for SR)
    CS...sorry to disagree with you.... I created a 
    function...as Chuck stated ..in an empty IB window: function 
    myFunction(x1,x2,x3,x4) { return (x1 + x2 + x3 + x4) / 4; } 
    Saved this as myfunction.afl Then in an empty IB window I 
    put the following: #include "C:\Program 
    files\Amibroker\Afl\myFunction.afl" x = myFunction(Open, High, Low, 
    Close); Plot(X,"",colorRed,styleLine); It worked..... 
    Anthony -------Original Message------- From: 
    equismetastock@xxxxxxxxxxxxxxx Date: Thursday, May 15, 2003 7:13:16 PM 
    To: equismetastock@xxxxxxxxxxxxxxx Subject: Re: [EquisMetaStock 
    Group] v8 System Tester Issues and how to fix.(for SR) Please 
    excuse me for cutting in... I haven't been able to get Chuck's 
    solution to access a function within theseparate AFL directory either, 
    until I used: Saved within C:\Program 
    files\Amibroker\Afl\myFunction.afl return (x1 + x2 + x3 + x4) / 4; 
    That's it. Just one line. No brackets. Now, within Indicator 
    Builder, my formula is: function myFunction( x1, x2, x3, x4 ) { 
    #include "C:\Program files\Amibroker\Afl\myFunction.afl" } 
    A2=myFunction( O, H, L, C ); Plot( A2,"function example", 
    colorRed ); Hit APPLY and it should work (with ver 4.36). I had 
    to insert the #include instruction since it doesn't appear that 
    ABfunction commands will search the hard drive for the saved afl file 
    bysimply stating x = myFunction(Open, High, Low, Close); AB 
    will search for the called function within Indicator Builder, but 
    itdoesn't appear to out on the hard drive. -CS ----- 
    Original Message ----- From: "Chuck Rademacher" 
    <chuck_rademacher@xxxxxxxxxx> To: 
    <equismetastock@xxxxxxxxxxxxxxx> Sent: Thursday, May 15, 2003 
    12:45 PM Subject: [EquisMetaStock Group] v8 System Tester Issues and how 
    to fix. (forSR) > I don't know why you are using java 
    script for your function. > > Try putting this into a file 
    caled myFunction.afl: > > function myFunction(x1,x2,x3,x4) 
    > { > return (x1 + x2 + x3 + x4) / 4; > } > 
    > > Then, in your "main" AFL, say: > > > 
    x = myFunction(Open, High, Low, Close); > > > It will 
    work just about every time... > > > > -----Original 
    Message----- > > From: SR [mailto:raftsp@xxxxxxxxx] > > 
    Sent: Thursday, May 15, 2003 6:28 AM > > To: 
    equismetastock@xxxxxxxxxxxxxxx > > Subject: [EquisMetaStock Group] 
    RE:RE: v8 System Tester Issues and how > > to fix. > > 
    > > > > > > Anthony, > > > 
    > I want to be able to create a function that will return a number 
    > > to another > > function that calls the first one. It 
    doesn't really matter whatmyFuction > > returns exactly. For 
    simplicity, suppose that what I want to  get is > > 
    (O+H+L+C)/4. I do know that this is so simple that it doesn't need to 
    bea > > separate function, but let's accept that this is what 
    we want to do. > > Actually I had problems with this one too! 
    > > Although I have never used java sript before, I thought I 
    could > > make such a > > simple script by just reading 
    the examples given. So, this is what Idid: > > First I created 
    a function named "myFunction" like this: > > > > 
    EnableScript("jscript"); > > <% > > function 
    myFunction(x1,x2,x3,x4) > > { > > return (x1 + x2 + x3 + 
    x4) / 4; > > } > > %> > > > > I 
    saved it in C:\Program files\Amibroker\Afl > > Please notice that 
    I have checked that a function called > > "myFunction" exists 
    > > there indeed! > > > > Then I tried the 
    calling formula: > > > > #include "C:\Program 
    files\Amibroker\Afl\myFunction.afl"; > > script = 
    GetScriptObject(); > > Graph0 = 
    script.myFunction(Open,High,Low,Close); > > > > The 
    problem is that each time I click 'Apply' I get this error: > > 
    > > Method/function 'myFunction' does not exist at line 3, column 
    96: > > > > > > Graph0 = 
    script.myFunction(Open,High,Low,Close) > > 
    ----------------------------------------------^ > > > > 
    1. I don't understand. I do see "line 3", but where is "column 96" inthe 
    > > above code? > > 2. "doesn't exist"?! But I do see 
    it! So, what is the mistake I > > have made in > > the 
    above formulas? > > 3. The program freezes all the time and I have 
    to shut it down andre-run > > it. > > 4. This is not 
    all. So far I have not managed to get a "Points-Only"test, > > 
    according to the instructions given. The tester keeps buying and selling 
    > > dozens of shares or contracts depending on the equity, 
    regardless > > of what I > > have written in the code. 
    > > 5. Sometimes I get rubbish on the main chart. > > 
    > > Maybe I have to re-install the program; maybe it is the RT 
    (eSignal) > > version..?? > > Is it the "demo"? Who 
    knows.. > > So, in case you can help with some of the above, I 
    will be very much > > obliged. > > I will also try once 
    more with the AB board, later. > > > > Thanks > 
    > > > Spyros > > > > 
    ________________________________________________________________________ 
    > > 
    ________________________________________________________________________ 
    > > > > Message: 6 > >    Date: 
    Wed, 14 May 2003 15:28:57 -0400 (Eastern Daylight Time) > 
    >    From: "Anthony Faragasso" <ajf1111@xxxxxxxx> 
    > > Subject: Re: RE:RE: RE: v8 System Tester Issues and how to 
    fix. > > > > Spyros, > > > > If you 
    want to give an example of what you are trying to do...then amore 
    > > helpful solution > > can be given... > > 
    > > Anthony > > > > -------Original 
    Message------- > > > > From: 
    equismetastock@xxxxxxxxxxxxxxx > > Date: Wednesday, May 14, 2003 
    10:07:13 AM > > To: equismetastock@xxxxxxxxxxxxxxx > > 
    Subject: [EquisMetaStock Group] RE:RE: RE: v8 System Tester Issues 
    andhow > > to fix. > > > > Anthony and 
    Kevin and Chuck thank you for your replies. > > > > 
    Chuck: > > > > 1. Obviously > > myVar = 
    myFormula() > > is not enough because it doesn't work [although I 
    am trying with version > > 4.30 (the latest?)] > > I 
    wouldn't mind to have to write a couple of lines including #include > 
    > directives etc. as > > Anthony suggests (in fact, I had 
    already tried that several times in the > > past) but I usually 
    get errors. > > That's why I keep asking and trying. I have 
    already read Janeczko's java > > script and VB examples > 
    > and a few messages on the AB board. Sometimes the #include 
    solutionworks, > > other times > > it does not. I 
    get unexpected and inexplicable errors. > > > > 2. I 
    asked on this board because the AB conversation was brought to this > 
    > board (not by me anyway). > > BTW my opinion is that such 
    conversations are not exactly off > > topic because > > 
    I guess that the > > members of this group are much more than just 
    MS users. Some of themhave > > already tried > > 
    other software (AB included), some have already asked questions 
    aboutsuch > > software and most > > of us would like 
    to have some elementary information about ... the restof > > 
    the world. > > > > 3. As I said, in the past I had 
    directly asked Janeczko about > > these problems > > but 
    I got no answer. > > Yes, he had rapidly replied to my first 
    message, but as the problem > > persisted, I had to ask again. 
    > > This time he did not reply. A few days ago I searched the AB 
    databasefor > > relevant messages. > > I found I 
    few, among which some replies by Janeczko. I must say thatthey > 
    > were not very encouraging. > > So, my impression so far is 
    that neither AB programming nor the > > communication is free of 
    problems. > > > > Please don't missunderstand me. I 
    still believe that AmiBroker is an > > excellent program. And as 
    far as > > programming is concerned it is much more powerful than 
    Metastock, > > which for > > different reasons > 
    > is also an excellent program. I am just saying that both programs 
    > > have their > > cons and unless > > the 
    function-calling problem is solved for good, this IMO will be > > 
    a major AB > > drawback. > > > > Anyway I will 
    make a new attempt with the AB group. > > Thanks again > 
    > Spyros > > > > > > > > Message: 
    16 > >    Date: Tue, 13 May 2003 20:19:24 -0400 
    > >    From: "Chuck Rademacher" 
    <chuck_rademacher@xxxxxxxxxx> > > Subject: RE: RE: v8 System 
    Tester Issues and how to fix. > > > > It's even easier 
    in AFL.   Just say: > > > 
    >       myVar = myFormula(); > > 
    > > Even better than MS, AFL will let you pass values to the 
    "other" > > formula as > > with this example: > 
    > > >       myVar = 
    myFormula(Open*1.1); > > > > A lot of people are willing 
    to help with AB/AFL questions, but > > feel awkward > > 
    answering them on this board.   If you ask questions like this on 
    the AB > > board, you will get a quick reply.  In fact, you 
    will get dozens > > of replies. > > > > > 
    -----Original Message----- > > > From: SR 
    [mailto:raftsp@xxxxxxxxx] > > > Sent: Tuesday, May 13, 2003 
    6:33 AM > > > To: equismetastock@xxxxxxxxxxxxxxx > > 
    > Subject: [EquisMetaStock Group] RE: v8 System Tester Issues and how to 
    > > > fix. > > > > > > > > 
    > > > > Kevin, > > > > > > Let me 
    add a question about AmiBroker. > > > What I want to do is very 
    simple: have a formula call another > > formula the > > 
    > way we do in MS: > > > > > > myVar:= 
    fml("myFormula"); > > > > > > Can this be done 
    with AFL? If yes, then how? Could you provide the AB > > > 
    equivalent? > > > > > > Whenever I ask this 
    question I get no answer! I have asked a > > couple of AB > 
    > > users privately, I have asked > > > publicly, I have 
    asked Tomasz Janeczko. No positive replies nonegative > > > 
    ones! Nothing! Very strange, isn't it? > > > > > > 
    So I hope you will be kind enough to post a reply. > > > Thank 
    you in advance. > > > > > > Spyros > > 
    > > > > > > > > > > 
    > > Yahoo! Groups Sponsor > > > > > 
    > > > > > > > To unsubscribe from this 
    group, send an email to: > > 
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx > > > > 
    > > > > Your use of Yahoo! Groups is subject to the 
    Yahoo! Terms of Service. > > > > > > > 
    > > > 
    ________________________________________________________________________ 
    > > > > > > > > To unsubscribe from 
    this group, send an email to: > > 
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx > > > > 
    > > > > Your use of Yahoo! Groups is subject to <A 
    href="">http://docs.yahoocom/info/terms/ > 
    > > > > > > ------------------------ 
    Yahoo! Groups Sponsor ---------------------~--> > Get A Free 
    Psychic Reading! Your Online Answer To Life's ImportantQuestions. 
    > <A 
    href="">http://us.click.yahoo.com/Lj3uPC/Me7FAA/uetFAA/BefplB/TM 
    > 
    ---------------------------------------------------------------------~-> 
    > > To unsubscribe from this group, send an email to: > 
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx > >  > 
    > Your use of Yahoo! Groups is subject to <A 
    href="">http://docs.yahoo.com/info/terms/ 
    > > Yahoo! Groups Sponsor ADVERTISEMENT 
    To unsubscribe from this group, send an email to: 
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx Your use of 
    Yahoo! Groups is subject to the Yahoo! Terms of Service. 
    To unsubscribe from this group, send an email 
    to:equismetastock-unsubscribe@xxxxxxxxxxxxxxxYour 
    use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of Service. 
    To 
  unsubscribe from this group, send an email 
  to:equismetastock-unsubscribe@xxxxxxxxxxxxxxxYour 
  use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.