Good morning,
i have gained some knowledge about using Visual Jforex to this day, but i've found a 'task' which i have troubles in getting through.
Let's say: Our strategy, in some circumstances, openes positions - we never know how many of positions may appear, number of positions in our strategy isn't fixed, or restricted in any way. There can be for example 3, just as well there can be 14 pending positions, or filled positions at the same time and there is no way of 'predicting' number of them.
And now, my problem:
how could i send some commands to NEWEST position only...?
If we would have, let's say, max 2 positions at a time, it would be very simple. We could just 'name' positions by using 'output value' in 'open at market' or 'pending order' block, and then compare 'create time' of those 2 positions in 'calculation' block, to see which creation time is bigger.
But if we don't know how many position they may be, how could we 'tell' the Visual Jforex, that we want to send commands >>only<< to position, that was added, or opened, or filled as last?
My little thoughts about possibilities of solving that:
1. making mechanism, which compares any creation time of all existing positions, and 'picking up' the largest value. Visual jforex has unix time, so bigger time value = later.
I'm not able to find blocks which can make it, i mean - function like 'compare all opening times and pick up biggest one'.
2. having somethins like 'get historical candle' - 'shift' function. If i place in 'get historical candle' block 'shift' 0 - it means 'newest candle', 'Shift' 1 - means previous, etc. I don't see something like that for positions.
3. making mechanism which is automatically naming positions with some numbers, like - first positions named 'position1', next one 'position2' etc - and than a mechanism, that somehow 'reads and understands' which position label has the greatest number value.
I'm not trying to say, that it is important to me to solve this problem at any particular way, i'm just showing up my thoughts. I just need any 'working answer'
I'm just wasting time now by being not able to work this at my own,
please write me a solution, i would be truly grateful,
Thank You in advance,
nine99