Topics
Replies
croucrou
31 Aug 2016, 14:00
Thanks for responding.
Inspired by first reply, to have only one position open at a time OnTick(), I now open position with:
var myPositions = Positions.FindAll("Label"); if (myPositions.Length == 0) //to enter return if (myPositions.Length >= 1) //to exit return
I don't know, if this is the best solution, but it works!
I did not check the "count" method, but I guess it needs an additional "using" reference and seems to be too complicated, doesn't it.
@croucrou
croucrou
13 Aug 2016, 17:26
Yes, but the question is of a general nature. It is not dependent on a particular code.
How to use the OnTick() method and not to open unlimited number of positions at that tick.
This seems to be a common issue and could be platform regulated and not require coding, actually.
@croucrou
croucrou
13 Aug 2016, 01:01
Hello and thank you for responding.
The "open close" method wouldn't work, as the orders open in the same moment unforunately.
The second way is looking promissing. Possibly this has been the answer. I will be looking into it.
I also found this link referring to MetaTrader and have been hoping for a solution like this:
@croucrou
croucrou
10 Sep 2016, 16:36
I would write it like this. I might be wrong, but it seems to me, that the indicator repaints.
@croucrou