The easiest
solution for me is to use Strategy 3. For a short sale I can have a study
line “SS” and for a long have a study line of “LL”
Logic then could be - since I will
know by the Study ID that this is Long or Short trade
If (Study("SS",SSID) > 0) {Do my shot stuff};
If (Study("LL",SSID) > 0) {Do my Long stuff};
With this
solution I will automatically know the current symbol, whether it is long or
short buy and how much I paid. Now I can use the chart for my “Trade
Plan” to plot resistance, support, stops, and next buys as well as where
in the plan I bought shares at. I can use AA to see when things are not
going as planned. It is not important to know for my trading plan how
many shares – only how the plan is progressing. I can
now scrap the hard code stuff and only use the study lines in the charts that
have them (When either “LL” or “SS” lines are
present I know I own them and can pay special attention). This method can
now work for a Watchlist (one) that contains both the stocks that I own and
stocks that I am just watching --- and when I own them – I can highlight
them as appropriate. Very little of my code needs to be
changed. It makes all the sense in the world to do my Trading Plan Graphically.
My concern in
using this strategy was “Note: When I mess with the
chart the Buy Price line is very sensitive and this can easily jump and be
inaccurate”. Amibroker already had
a solution I have discovered, “Lock Position” in the line
Properties”. Sweet!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Never noticed it.
Life is tough as an “Intermediate Novice” –
but then there is so much to learn with the tool and with trading. Having
a trading plan and developing this
trading plan using a Amibroker Chart -- I feel -- will better keep
me in the trade and prevent “whipsawing” especially in this volatile
market the last few days.
Still curious on Is there a easy way to read the new account management information and
use that information (buy price, Long/short position, date, etc) in AFL? I am
currently not using the account management feature.
Dave
From: David Weller
[mailto:wellerdr@xxxxxxx]
Sent: Wednesday, August 08, 2007
10:10 AM
To: 'amibroker@xxxxxxxxxxxxxxx'
Subject: New Account Management
Feature
Current: My current system monitors a watchlist
and gives me the appropriate Buy and sell signals in AA as does all
systems. If I own the stock (I physically initialize the Ticker and Buy Price
in the code for 5-7 stock)s and if it triggers some alert condition (Higher
CLOSE maybe buy some more) I set colors, signals, etc to let me know that I
must do something.
Example of hard code where symbolm is on a watchlist and I
own it – then I need to pay more attention so I use color
PR1=27.47; NN1 ="EWA"; if (Name()==NN1) {PR=PR1;
CondLong = 1; }
I am thinking of improving this “physically typing in
the symbol and buy price directly into the code” method to a more
flexible one.
Possible strategy1: Use the Account management
feature; get buy/short info from there, convert account file to .csv file and
read into my AFL instead of hard coding. This is the one I want to use if
I can as it would allow me to use several different portfolios and is all in
one place. Is there a easy way to read
the new account management information and use that information (buy price,
short, date, etc) in AF?.
Possible Strategy2: Just create a .CSV file using
Excel and read into AFL using FOPEN instead of hard coding.
Possible Strategy 3: Just use a
Study(“BP”) for the buy price in the chart, and in the AFL if it
triggers some alert condition (Higher maybe buy some more) I can set colors,
signals, etc to let me know that I must do something. Very little
of my code would need to be changed but would not account for a long or short
condition. Maybe I can live with this. Note: When
I mess with the chart the Buy Price line is very sensitive and this can easily
jump and be inaccurate.
Current code for support and resistance in which I could add
something for buy price (BP)
Per20 = (Study("RE",SSID)-Study("SU",SSID))*.20;
AddColumn(C < Study("SU",SSID)+Per20, "Buy Back",1.2,colorBlack,
IIf(C <
Study("SU",SSID)+Per20, colorYellow,
colorGreen)); //20 % above support
Trigger to buy some more or to sell in a down trend
How are other people doing this in their
code?
Just trying to do some planning before I jump into
code. Current method works ok for now.
Best regards
Dave