Replies

alexgbg30@gmail.com
17 Nov 2017, 00:19 ( Updated at: 21 Dec 2023, 09:20 )


@alexgbg30@gmail.com

alexgbg30@gmail.com
17 Nov 2017, 00:09

RE:

croucrou said:

Hello,

how to trade with the OnTick method and not to get overwhelmed by thousands of positions opened at the very same time?

I asked a similar question time ago, but didn't get a simple solution and I am sure there must be one though.

Please advise.

Thank you.

for example if you want to open one position or 2 or more when position closed

and there is 3 position closed at the same time, and if you let it, it will ceep duplicate until hundreds or  thousands

U can chose how many ticks it will hold opening position before let the code continue working 

         [Parameter(DefaultValue = 1)]
        public int Value { get; set; }

        [Parameter(DefaultValue = 50)]
        public int TakeProfit { get; set; }

        [Parameter(DefaultValue = 800)]
        public int StopLoss { get; set; }

        [Parameter(DefaultValue = 10)]
        public int MaxTick { get; set; }   // U can choose how meny ticks its going to wait befor open a new position




        int tick = 0;






//  //  //  //  //  //  // OnStart

        protected override void OnStart()
        {
            Positions.Closed += PositionsOnClosed;

        }


//  //  //  //  //  //  // OnClose
        private void PositionsOnClosed(PositionClosedEventArgs args)
        {
            if (tick == 0)
            {
                ExecuteMarketOrder(TradeType.Buy, Symbol, Value, "Buy2", StopLoss, TakeProfit);
                ExecuteMarketOrder(TradeType.Sell, Symbol, Value, "Sell2", StopLoss, TakeProfit);
                tick = 1;
            }
        }


//  //  //  //  //  //  // OnTick

        protected override void OnTick()
        {


            var BP = Positions.FindAll("Buy").Length;
            var SP = Positions.FindAll("Sell").Length;

            if (tick >= 1)
            {
                tick = tick + 1;
                if (tick >= MaxTick)
                {
                    tick = 0;
                }
            }
 

 

if there are any thing else just let me know 


@alexgbg30@gmail.com

alexgbg30@gmail.com
01 Aug 2017, 05:18 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Spotware said:

Dear Trader,

Thanks for your question. cTrader can handle more than 400 positions simultaneously without a problem. But due to the fact that cTrader is has a rich UI, much richer when compared to other platforms, it might become slow when a lot of information that needs to be updated in real time is displayed on the chart. We are working on improving the performance of this part of cTrader.

In the meanwhile, in case you want to open a large number of positions in cTrader e.g. more than 400, we advise that you first hide positions and the deal map from the chart. In order to do so, right click on the chart, go to Viewing Options and uncheck Positions. See image below

Best Regards,

cTrader Team

 

 

Hello spotware

after testing hide positions and deal map

it works excellently

thanks for your respond 


@alexgbg30@gmail.com

alexgbg30@gmail.com
21 Jul 2017, 22:31

RE:

Spotware said:

Dear Trader,

We plan to optimize our platform in the future. For now we can recommend you to have not more than 500 positions and pending orders.

Dear spotwear

it's almost 2018 and and still struggling after opening over than 500 positions


@alexgbg30@gmail.com