Profile Picture

Determining position status - short vs long?

Posted By uaruss 6 Years Ago
Message
Posted Tuesday November 01 2011
I am having an issue figuring how how to identify my position type. I have tried Position.Type.Equals("Long") and "If(PositionType.Short) Then...", "If(PositionType.Short=1) Then...", etc... but nothing seems to work. I don't have a problem opening a position of long or short, but i just can't do and if/then statement to determine if it's long or short. any help would be much appreciated!

Also, I looked through the help files, but haven't been able to find much on the language portion of this app. I programmed in college and am decent with VB, but it'd be great if there's another help file out there that i'm missing.

Thanks in advance!
phg
Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)Supreme Being (48,413 reputation)
Posted Tuesday November 01 2011
The RHS should be from an enumeration. See intellisense after the period: PostionType.xxx  'xxx' will show as Long or Short.
You didn't show enough of the LHS, so here is an example:

<code>
foreach(Position pos in OpenPositions)
if(pos.Type == PositionType.Short)
. . .
<code/>

Does this help?

-Pete

See also Yahoo group about applying RE.


Edited: Tuesday November 01 2011 by phg
Posted Wednesday November 02 2011
that worked! thanks so much for the quick response!!


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems