CBOT does not open any trades

Created at 07 Jan 2022, 18:54
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!
IC

icollocollo

Joined 26.11.2021

CBOT does not open any trades
07 Jan 2022, 18:54


Hello

Someone help me see why this cbot does not place any trades. i got some code snippets from this forum, It checks if the daily candle is bullish or or bearish, it also has a break even and partial volume close. executes on a lower timeframe based on price action. It also check if there is a rejection or break of a Fractal using the fractal indicator shared here. 

fractals indicator link

code below

code removed

 


@icollocollo
Replies

firemyst
09 Jan 2022, 15:43

A few questions:

1) have you looked in the "Log" tab when your bot is running to see what happens? If there's a crash or something?

2) Have you tried putting any "Print" statements in your code to output information to the log? for instance, how do you know all the following statements ever evaluate to "true" for the order to be opened?

if (UpHigh && UpTrend)
                    {
                        if (UpBreak || DownSpring)
                        {

                            if (UpKabuti)
                            {
                                Open_Buy_Order();
                                return;
                            }
                        }
                    }

For all you know, all those "if" statements may not be evaluating to true, and thus the "Open_Buy_Order" method is never executed.

 

So I would try putting in Print statements to log output, so you can see where the code is executing, and if it's even getting to the method to open an order.


@firemyst

icollocollo
10 Jan 2022, 14:16

RE:

firemyst said:

A few questions:

1) have you looked in the "Log" tab when your bot is running to see what happens? If there's a crash or something?

2) Have you tried putting any "Print" statements in your code to output information to the log? for instance, how do you know all the following statements ever evaluate to "true" for the order to be opened?

if (UpHigh && UpTrend)
                    {
                        if (UpBreak || DownSpring)
                        {

                            if (UpKabuti)
                            {
                                Open_Buy_Order();
                                return;
                            }
                        }
                    }

For all you know, all those "if" statements may not be evaluating to true, and thus the "Open_Buy_Order" method is never executed.

 

So I would try putting in Print statements to log output, so you can see where the code is executing, and if it's even getting to the method to open an order.

Thank you for your reply,

for number 1, i get backtesting started and backtesting finished.

i will definitely try to print some statements. Its very possible that some statements never evaluate to true. Thank you for this insight!


@icollocollo