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

[amibroker] Re: sorry, but the variable (array) structure and general nastiness of AFL makes



PureBytes Links

Trading Reference Links

 These are all the position management built-in functions available in
Wealth-Lab, which is the program that I know best:
 You can check this in more detail at wealth-lab.com in the function
reference help section. Of course that there are a few that are more
used than others, but with these you get the idea.
Personally, Positionentryprice, positionlong, positionprofit,
positionopenprofit, are those that are often used and make the coding
 task easier. 

 "Position Management Functions

The following functions let you manage and get information on open
Positions in WealthScript.  Any function that accesses a Position
requires a Position Index.  Position Index starts at zero, and goes up
to PositionCount - 1.

ActivePositionCount: integer;
Returns the number of active Positions currently being held by the
trading system.

ClearPositions;
Clears out all Positions and Alerts.

GetPositionData( Position: integer ): float;
Returns the value of any user-specific data for the Position.

GetPositionPriority( Position: integer ): float;
Returns the Priority value that was assigned to the Position via a
call to SetPositionPriority.

GetPositionRiskStop( Position: integer ): float;
Returns the Risk Stop Level (the initial stop price) of the Position.

LastActivePosition: integer;
Returns the index of the most current active Position. If there are
not active Positions, the function returns -1.

LastLongPositionActive: boolean;
Returns true if the last long Position is currently active.

LastPosition: integer;
Returns the Position number of the most recently created Position.

LastPositionActive: boolean;
Returns true if the last Position is currently active.

LastShortPositionActive: boolean;
Returns true if the last short Position is currently active.

MarketPosition: integer;
Returns a 0 if there are currently no open Positions, 1 if the last
open Position is long, and -1 if the last open Position is short.

PositionActive( Position: integer ): boolean;
Returns true if the Position is open, and false if it has been closed.

PositionBarsHeld( Position: integer ): integer;
Returns the number of bars the specified Position was active.

PositionBasisPrice( Position: integer ): float;
Returns the Basis Price of the specified Position. The Basis Price is
the price used to establish the size of the Position.

PositionCount: integer;
Returns the total number of Trading System Positions, both open and
closed.

PositionEntryBar( Position: integer ): integer;
Returns the bar number on which the Position was established.

PositionEntryPrice( Position: integer ): float;
Returns the entry price of the specified Position.

PositionExitBar( Position: integer ): integer;
Returns the bar number on which the specified Position was closed.

PositionExitPrice( Position: integer ): float;
Returns the exit price of the specified Position.

PositionExitSignalName( Position: integer ): string;
Returns the "Signal Name" of the exit signal for the specified Position.

PositionLong( Position: integer ): boolean;
Returns true if the specified Position is long, and false if it is short.

PositionMAE( Position: integer ): float;
Returns the Max Adverse Excursion of a closed Position.

PositionMAEPct( Position: integer ): float;
Returns the Max Adverse Excursion of a closed Position in percent.

PositionMFE( Position: integer ): float;
Returns the Max Favorable Excursion of a closed Position.

PositionMFEPct( Position: integer ): float;
Returns the Max Favorable Excursion of a closed Position in percent.

PositionOpenMAE( Position, Bar: integer ): float;
Returns the Max Adverse Excursion of an open Position, or the MAE for
a Position as of the specified Bar.

PositionOpenMAEPct( Position, Bar: integer ): float;
Returns the Max Adverse Excursion of an open Position, or the MAE for
a Position as of a specified Bar, in percent.

PositionOpenMFE( Position, Bar: integer ): float;
Returns the Max Favorable Excursion of an open Position, or the MFE
for a Position as of a specified Bar.

PositionOpenMFEPct( Position, Bar: integer ): float;
Returns the Max Favorable Excursion of an open Position, or the MFE
for a Position as of a specified Bar, in percent.

PositionOpenProfit( Bar, Position: integer ): float;
Returns the current profit level of the Position as of the specified
Bar in dollars.

PositionOpenProfitPct( Bar, Position: integer ): float;
Returns the current percentage profit level of the Position as of the
specified Bar.

Desc=PositionOrderType( Position: integer ): integer;
Returns an integer indicating the type of order used for the specified
Position.

PositionOrderType( Position: integer ): integer;
Returns an integer indicating the type of order used for the specified
Position.

PositionProfit( Position: integer ): float;
Returns the net profit in dollars of the specified closed Position.

PositionProfitPct( Position: integer ): float;
Returns the percentage profit of the specified closed Position.

PositionShares( Position: integer ): integer;
Returns the number of shares (or contracts) in the specified Position.

PositionShort( Position: integer ): boolean;
Returns true if the specified Position is a short Position.

PositionSignalName( Position: integer ): string;
Returns the "Signal Name" of the entry signal for the specified Position.

PositionSymbol( Position: integer ): string;
Returns the symbol of the selected Position.

SetPositionData( Position: integer; Data: float );
Lets you store user-specific data (a single floating point number) at
a Position level."

 
 


--- In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxx> wrote:
>
> How about listing those with a little explanation of each?
> 
> d 
> 
> > -----Original Message-----
> > From: amibroker@xxxxxxxxxxxxxxx 
> > [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of pmxgs
> > Sent: Tuesday, April 24, 2007 12:46 PM
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: sorry, but the variable (array) 
> > structure and general nastiness of AFL makes
> > 
> > 
> >    In my opinion afl and it's array processing language are really
> > good and intuitive.
> >   For me, that I'm not a programmer, the only thing that afl is
> > lacking is more built-in position management functions.
> >  If you compare Amibroker and Wealth-Lab, the two programs that i know
> > best, Wealth-Lab has a lot of built-in position management functions
> > which are a great help, at least for me that I'm not a experienced
> > programmer.
> >  I hope that these built-in will be implemented as the development
> > course of Amibroker .
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Ed Hoopes" 
> > <reefbreak_sd@> wrote:
> > >
> > > What you need to do is to create in your mind a model of how .afl
> > > works.  This can be done by reading the documentation supplied with
> > > the software, and watching the tutorials on the website.  
> > Once this is
> > > done it will be easy to create code to do the things  you want.
> > > 
> > > You might think how do I know?  I'm in my mid 60s and have
> > > professionally (that is worked for W-2 income) programmed in:
> > > 
> > > PDP-11 assembly language
> > > Fortran
> > > Cobol
> > > Datatrieve
> > > Forth (a TRULY nasty lang that uses Reverse Polish Notation)
> > > DCL
> > > JavaScript
> > > C
> > > 
> > > AFL is neither exceptionally better or worse than any of the above. 
> > > 
> > > It is a specialty language for processing data in arrays, then
> > > plotting the results.  It does a good job at what it was 
> > designed to do.
> > > 
> > > Reef-Break
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Homar Simpson" <x77777x@> wrote:
> > > >
> > > > programming in Amibroker an unpleasant  experiance every time I
> > > > attempt to do the simplest thing.
> > > > 
> > > >  Power without ease of use is useless.
> > > >
> > >
> > 
> > 
> > 
> > 
> > Please note that this group is for discussion between users only.
> > 
> > To get support from AmiBroker please send an e-mail directly to 
> > SUPPORT {at} amibroker.com
> > 
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> > 
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >  
> > Yahoo! Groups Links
> > 
> > 
> >
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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