JSParticipant
Senior
Suppose I buy 1 contract on BarIndex = 1000 and I sell this contract on BarIndex = 2000
And I buy 1 contract on BarIndex =3000 and I sell this contract on BarIndex = 4000
What is the value of:
TradeIndex(1)
TradeIndex(2)
TradeIndex(3)
TradeIndex(4)
Etc…
Appending these lines to any strategy might help:
Graph BarIndex
Graph TradeIndex(1)
Graph TradeIndex(2)
Graph TradeIndex(3)
Graph TradeIndex(4)
JSParticipant
Senior
Thanks Roberto,
I had done that, but I couldn’t place the results well:
TradeIndex(0) = 0
TradeIndex = TradeIndex(1) = 4001
TradeIndex(2) = 3001
TradeIndex(3) = 2001
TradeIndex(4) = 1001
TradeIndex(5) = 0
TradeIndex is the BarIndex when either a trade is
a) opened,
b) closed.
At every new operation the TradeIndex is shifted one place. If it’s a Stop & Reverse (exit followed by a new open), two places are shifted and both the Exit of the previous trade and the open of the new one share the same BarIndex, despite they will have a different TradeIndex ID due to the sequential occurrences.
The 4 attached pics should make it clear what the process is like.