i have a couple of questions, i am working on an automated strategy that would take multiple positions, and i want to know what coding alternatives would i have to know the exact entry price of the latest position the strategy opened. let's say the entries looked a little something like this; when the uptrend condition first becomes true a first position would be opened, and then if time (number of bars observed) goes by and no new lower lows have been observed, the strategy would open up several additional positions:
if uptrend; { EnterLong(ps01, "p01"); } if bars later and no new lower lows; { EnterLong(ps02, "p02"); } if bars later and no new lower lows; { EnterLong(ps03, "p03"); } if bars later and no new lower lows; { EnterLong(ps04, "p04"); } if bars later and no new lower lows; { EnterLong(ps05, "p05"); }
i want to know the entry price of each individual position (as is evident, each of them would have its own name) so that i can manage stops individually for each position if price moves for - against me, and also so that i could know how all the positions are doing collectively.
is there any command to call the exact entry price of a given entry so that i could adjust the stops for all positions as price moved for - against me? or alternatively, if it was possible to set a trailing stop for each individual entry since that particular position was opened, how could i do that?
also, all of these entries are market orders as far as i understand. could it be possible to place limit orders for these long positions a number of ticks below the price observed when the order is triggered? and how could the strategy know whether or not the order ever got filled and at what price?
very well, thanks.
Comment