Description Usage Arguments Details Value Author(s)
A position object will store the details of trade opening, price, qty, closing etc. Once a position is opened, till close the same object can be carried forward for further operations.
checks if given object is position type/class
check if position is open/closed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | position(instr = "default")
is.position(pos)
isopen(x)
## S3 method for class 'position'
isopen(pos)
isclosed(x)
## S3 method for class 'position'
isclosed(pos)
islong(x)
## S3 method for class 'position'
islong(pos)
isshort(x)
## S3 method for class 'position'
isshort(pos)
qty(x)
## S3 method for class 'position'
qty(pos)
## S3 method for class 'position'
posA + posB
## S3 method for class 'position'
posA - posB
get.positions.table(pf = "default")
get.positions.id(pf = "default")
incr.positions.id(pf = "default")
|
instr |
- instrument to be carried with position |
pf |
- default "default" |
pf |
- default "default" |
pf |
- default "default" |
position - Creates an empty position object
isclosed - gives TRUE if qty is zero and position is opened
islong - checks if position is long/short
isshort - checks if position is long/short
qty - Gives the quantity of a position, according to the direction of the position. Returns +ve qty if long, -ve otherwise
"+" - Quantities are added & openprice is averaged
"-" - only quantities are substracted
get.positions.table
get.positions.id
incr.positions.id
returns position object
returns TRUE if position is opened, FALSE otherwise
returns the positions for each and every execution
returns the position id that is created currently. This is a global variable at portfolio level.
returns the position id that is created currently. Increments the old id by 1
Siva Sunku
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.