Topics
Replies

svobod8
28 Feb 2016, 22:21

RE:

Bump :), anybody?

Hi,

apparently  I don't get how the Positions collection work. Running this robot on EURUSD pair prints "Positions: 0" even though the order was fullfiled and neither its TakeProfit nor its StopLoss was reached (thus the position exists).

public class Tutorial : Robot
    {
        private int orders = 0;

        protected override void OnTick()
        {
            if (orders == 0)
            {
                PlaceLimitOrder(TradeType.Buy, Symbol, 1000, 0.5, "buy order", 1000, 1000);
                orders++;
            }
            else
            {
                Print("Positions: ", Positions.Count); // always prints out "Positions: 0"
            }
        }
    }

Could you explain or point me towards an explanation?

Thank you,

Jaromir

 


@svobod8