after searching around for hours I didn't come to a solution to my problems. So perhaps you can either indicate a solution if it exists or point to the correct links.
I want to code a system with the following features:
1. Given a particular entry signal, entry orders at market should be placed. The signal can ask for recurrent entries in the same direction (so I am not "hedging", no conflict of long and shorts), number of entries is unknown. So I cannot establish in advance a "name" for the different trades in the same direction.
2. Every trade must last a specified number of bars after entry. The BarsSinceEntry method has as an argument a string. And of course it is useless without arguments, because I don't need the information about the last entered trade.
3. Given (another kind of) opposite signal, all trades must be unconditionally closed (i.e. either they are stopped by the time limit, or reach take profit or stop loss, or are closed by the "opposite" signal).
Now, being a self-though bad programmer I would ask whether there is an elegant C# solution to this problem (which would likely be to assign a non-changing, unlimited, numerical identifier to each order), or if, with a very dirty "C-like" approach, the only solution would be to manipulate strings, casting an integer to string and eventually appending it to a label like "TradeN_" when entering a trade and then make the reverse process when it is time to exiting trades (like making a for cycle re-casting the index to string for identifying the single orders)

Would a strategy with the specification above be possible also with managed order handling or just with the unmanaged? [Note: in future version of the system stop loss and take profit need also to be changed on a bar-basis, so this would imply again going on with the dirty number-to-string procedure for each position...]
Thanks in advance for all the possible help.
Sorry: I would like to understand the thing by myself, so do not simply suggest to hire a coder (as far as possible!).
Bye
F
