I want to do Label

Created at 15 Jan 2017, 18:27
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TH

thippakorn_2558

Joined 27.02.2016

I want to do Label
15 Jan 2017, 18:27


             if (rsi.Result.LastValue < 25 && _position == null)
            {
                OpenPosition(TradeType.Buy);
            }
            if (rsi.Result.LastValue > 75 && _position == null)
            {
                OpenPosition(TradeType.Sell);
            }
            if (_position != null)
            {
                if (_position.TradeType == TradeType.Buy && rsi.Result.LastValue > 55)
                {
                }

                if (_position.TradeType == TradeType.Sell && rsi.Result.LastValue < 45)
                {
                }
            }
            if (Account.Equity - Account.Balance > Profit)
            {
                foreach (var position in Account.Positions)
                {
                    Trade.Close(position);
                }
            }
        }
        private void OpenPosition(TradeType command)
        {
            Trade.CreateMarketOrder(command, Symbol, Volume);
        }

        protected override void OnPositionOpened(Position openedPosition)
        {
            _position = openedPosition;
        }

        protected override void OnPositionClosed(Position closedPosition)
        {
            _position = null;
        }
    }
}


@thippakorn_2558