--- In amibroker@yahoogroups.com, Keith McCombs <kmcco...@...> wrote:
>
> Michael --
> I compared your trades with your log file.  And observed that all 
> of your 'missing' trades attempted to buy on the *same* day as you
> closed a previous trade.  That is only a hint.  See attachment.

Thank you, basing this on observation (not fact), that explains where they 
went.  AB is 'skipping' opens if there's a close on that bar and my logging is 
capturing them as real trades.  I can work with that.

> Other comments:
> I just briefly scanned your code.  And I notice that you use for
> loops a lot, and also there were no Ref() or ExRem() functions.
> I am guessing that you could do without so many for loops and 
> with somewhat simpler code.

You use what you know :)  I know for loops, and I'm specifically trying to 
capture all trade opens (as limit orders at a broker would do the same).  When 
I get the for loops to validate, then I can dig into doing it with AB specific 
language.

I do have to admit, I've become very frustrated at having to work around not 
being able to natively do multiple Sells on the same bar.

I would ask if anyone know how much Tomasz charges for an hour, but if I don't 
learn why it was coded the way it was coded, then I won't have the proper 
foundation to be able to move forward with more advanced concepts...

> Also, I noticed that iif() was not capitalized as IIf(), indicating
> that at least this part of your code had not been checked
> in AB's Editor.

I don't use AB's Editor, I'm more comfy with *nix, but my editor of choice for 
AB is Notepad++ as you can set it to treat a .afl as a C source file.  (I'm 
also horrible at blowing "{" "}" levels, which Notepad++ highlights well.)

> It would be much easier to compare the log with the trades.html
> if the log file looked more like the trades file.  
> For example, open and close of trade on the same line.

I've tried, but so far I haven't figured out how to do something like:

op = StrFormat(",%02.0f-%02.0f-%02.0f,%02.0f:%02.0f:%02.0f", y[ i ], m[ i ], d[ 
i ], r[ i ], e[ i ], n[ i ] );
op = op + StrFormat(",%g,%.4f\n", j, buyPrices[j] );
openPos[j] = op;

So I can let the Sell log both the Buy and Sell.

AB keeps bitching that openPos() must have a number :(

Is there anything to assign strings to arrays in AB?  Besides this reference 
from 2006? (Which would seem to be a huge performance hit?)

StaticVarSetText("MyVar" + Name() + i , "text at bar i");
textatbari = StaticVarGetText("MyVar" + Name() + i);

> That being said, based on your forum postings, you have been
> using AB for only about a month.  You're miles ahead of where
> I would expect one to be, after such a short time.
> 
> -- Keith

Thank you Keith, AB does have a steep learning curve :)

Best Regards,
Michael


Reply via email to