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

Re: [amibroker] TJ / UM - AB & ABtool v0.0.6 beta - Question



PureBytes Links

Trading Reference Links

Fred,

There is an error in your code:

 if ((k = 1) || ((k > 1) && (CurrScore > SelScore)))

In this line you assign 1 to K variable.
If you want to make a comparison use
k == 1 

(double = sign)


The same here:
 if ((k = i - 1) || ((k > 1) && CurrDate > PrevDate))

should be:

 if ((k == i - 1) || ((k > 1) && CurrDate > PrevDate))

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Fred" <fctonetti@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, May 06, 2003 7:24 PM
Subject: [amibroker] TJ / UM - AB & ABtool v0.0.6 beta - Question


> TJ,
> 
> Below is a code snip from a routine to process a table that's already 
> been filled ...
> 
> After the first statement below th1RowCount can be confirmed to have 
> 150 in it from looking at the Export of the Table.  However, when 
> running Debug View with a couple of imbedded _Trace commands below 
> one can see that the "For k" message gets executed only once.  I 
> suspect the problem is in my code but I'll be fried if I can see it.
> 
> UM, 
> 
> With regards to the Bug #2 that I reported about doing a TabelDataGet 
> of a String from Table #1 and then trying to put it in Table #2, see 
> the code below ... The noted out statement is the one that causes 
> problems.  As I stated I can verify that what it got in the 
> TableDataGet statement is a string ( Type 3 ).  Any ideas what's 
> going on with this ?
> 
> =========
> 
> th1RowCount = TableGetRowCount(th1);
> SelScore = 0;
> m = 0;
> _TRACE("Got Row Count");
> for (k = 1; k < th1RowCount; k++)
> {
>     _TRACE("For k");
>     DebugFld  = th1RowCount;
>     CurrDate  = TableDataGet(k, 1, th1);
>     CurrScore = TableDataGet(k, 3, th1);
>     if ((k = 1) || ((k > 1) && (CurrScore > SelScore)))
>     {
>         SelTicker = TableDataGet(k, 0, th1);
>         SelDate   = TableDataGet(k, 1, th1);
>         SelClose  = TableDataGet(k, 2, th1);
>         SelScore  = TableDataGet(k, 3, th1);
>         SelSignal = TableDataGet(k, 4, th1);
>     }
>     if ((k = i - 1) || ((k > 1) && CurrDate > PrevDate))
>     {
>         TableDataAddFloat(DebugFld,  m, 0, th2);
> //        TableDataAddStr  (SelTicker, m, 1, th2);
>         TableDataAddInt32(SelDate,   m, 2, th2);
>         TableDataAddFloat(SelClose,  m, 3, th2);
>         TableDataAddFloat(SelScore,  m, 4, th2);
>         TableDataAddInt32(SelSignal, m, 5, th2);
>         SelScore = 0;
>         m = m + 1;
>     }
>     PrevDate = TableDataGet(k, 1, th1);
> }
> TableExport("C:/Work/ABTool-Trade.csv", ",", th2);
> 
> 
> 
> 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 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/KXUxcA/fNtFAA/uetFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/