Help me.

Created at 20 Jul 2021, 18:51
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!
HO

HoangHiep

Joined 16.06.2021

Help me.
20 Jul 2021, 18:51


I'm happy to have someone.
I want every negative 20pip to automatically stuff more orders with the same volume.
20-40-60-80

#region ontick
        protected override void OnTick()
        {
            var position = Positions.Find(InstanceName, SymbolName);

            {
                if (_rsi.Result.Last(1) > 30 && _rsi.Result.Last(1) < 70 && _rsi.Result.IsFalling())
                {
                    if (position == null)
                        ExecuteMarketOrder(TradeType.Buy, SymbolName, volume, InstanceName, StopLossInPips, TakeProfitInPips);
                }


                if (_rsi.Result.Last(1) < 10 && _rsi.Result.Last(1) > 70 && _rsi.Result.IsRising())
                {
                    if (position == null)
                        ExecuteMarketOrder(TradeType.Sell, SymbolName, volume, InstanceName, StopLossInPips, TakeProfitInPips);
                }

            }
        }
        #endregion
    }
}


@HoangHiep
Replies

amusleh
22 Jul 2021, 10:06

Hi,

Your question is not clear at all, nor is your code.

Please read the Automate API references before asking for help.


@amusleh