Topics
Replies

firemyst
11 Mar 2025, 00:42

RE: RE: Error running cBot in Cloud

hendrikf said: 

firemyst said: 

You haven't described what your bot does.

Maybe you're trying to do something that's not allowed for cbots in the cloud, like sending emails, accessing the internet, drawing things on charts, etc etc.

Apologies for the late reply. The error occurs whenever I use the StochasticCalculationType parameter when I define a stochastic oscillator. There was an update but now it gives another error. I haven't checked it recently so it may be fixed.

I use the Spotware unbranded version of CTrader. 

Hendrik 

There are and have been lots of issues with bots in the Cloud. In my opinion, since Spotware doesn't even appear to be fixing/investigating the issues, it's obviously not a mature product, and I wouldn't bother with their cloud option. Stick with a VPS or running locally. If you look through the reads in the forum, you'll see lots of people having lots of issues with the cloud.


@firemyst

firemyst
11 Mar 2025, 00:35

RE: RE: RE: RE: TICK !

mike.r.alderson said: 

 

The only trick I'm aware of that might ‘fool’ the market would be to use code to create a LOT of Limit orders that might manipulate market price but I believe someone went to prison for that in recent years :/

 

You don't need lots of orders. For TP's, all you need is one that keeps “readjusting itself” every time the bid or ask price gets close to it. 

And for SL's – you can have other “SL's” that aren't the actual drag/drop SL line in cTrader to avoid the “stop” hunters from seeing your actual SL placement. I would still keep the actual cTrader SL on the chart though as a last resort. 

There are other tips – but that's all I'm saying for now because self-discovery can be a wonderful thing. :-)

 


@firemyst

firemyst
11 Mar 2025, 00:15

RE: RE: RE: RE: How to put start button back to the stopped state?

rick2010 said: 

firemyst said: 

Just say “Stop();”

That stops the bot entirely. You'll have to click the “Start” button to restart the bot.

I tried calling OnStop() and that didn't work… I wasn't aware there was a Stop().

Thanks.

You're welcome. OnStop is an “event” method. 

I suggest you read the lifecycle of bots since you don't seem to be fully aware of the lifecycle of bots or their associated event methods:

help . ctrader . com/ctrader-algo/articles/for-developers/cbot-lifecycle/#how-to-use-the-onstop-method

 


@firemyst

firemyst
10 Mar 2025, 13:17

RE: RE: How to put start button back to the stopped state?

rick2010 said: 

firemyst said:  What do you mean?

 

Hi, in on start I calculate some info… if that calculation fails I need to stop the algo.

protected override void OnStart() {

 if(Calc() == false)

    return;

}

But returning from on start doesn't put the start button into the stopped state.

 

Just say “Stop();”

That stops the bot entirely. You'll have to click the “Start” button to restart the bot.


@firemyst

firemyst
10 Mar 2025, 12:39

AS I responded in your post in the other forum, there are lots of issues with the Cloud.

Read other posts in this forum to get even more caught up


@firemyst

firemyst
10 Mar 2025, 12:38

There are lots of issues with the Cloud. Read other posts to in this forum to get caught up


@firemyst

firemyst
10 Mar 2025, 12:02

RE: RE: TICK !

Thank you for this explanation, it really is appreciated.  I can't believe I missed that for so long.

 

On the downside, I now have backtested proof that this strategy I spent months on…. simply doesn't work.  Even with a wide-range of variables in what I call an Optimisation ‘Spray and Pray’ :D.
 

I've coded and backtested every strategy I can find or think of, hundreds of them, and I've found maybe one that really stands the test of time with like 2 trades per year.

I'm starting to think that the likes of Gary Stevenson are right: Day Trading/Swing Trading doesn't work and the only way to make real money is wait for a super low price, go in with a reduced Lot size and wait for as long as it takes to make real profit: weeks/months/years.

 

I wouldn't give up. You can code a strategy that works reasonably well… I've been using one of my bots for 2 years now with good results (albeit I also watch and keep an eye on the trades just in case the market is doing something crazy). 

You may find you have to limit your strategy to certain times of the day, or code your bot in such a way it gets your entries with some basic stoploss/take-profit management, and then you (human) have to manage as well.

There are some other tricks of the trade you can employ too to “fool” the markets a bit. 

Lastly, since your strategy worked fine with the 1-minute bar data, why not readjust your code to work on every “Bar” instead of every “tick”? That's how I accidentally discovered the strategy I've been using with a good amount of success. :-)


@firemyst

firemyst
10 Mar 2025, 09:00

RE: Indicators are not visable

kevin.sansom said: 

Same Issue here after 5.1.14.38304 update only some of my custom indicators work. I tried to rebuild them in Algo and get the following error for all indicators.
“Error CT0006: Unable to publish algo after several attempts.”

Also unable to create new indicator, cBot or Plugin.

Are you using Visual Studio or any 3rd party IDE tool? Or just the cTrader compiler?

I'm using VS 2022 Community edition and I haven't experienced any such issues myself (thankfully)


@firemyst

firemyst
10 Mar 2025, 08:52

Maybe it's not trading because the conditions to place a trade haven't been met during that time period (if at all)?


@firemyst

firemyst
10 Mar 2025, 00:42 ( Updated at: 10 Mar 2025, 00:44 )

What do you mean?

If the algo has conditions that need to be met to Start(), then the algo is already running if it's looking to meet these conditions. An algo can't be running to see if it meets conditions to “start” and have the button not showing as “running”. 

If the button isn't showing as running, then algo isn't running. 

I'm not sure you understand the events in algo?

The “start” method is what's executed when the bot is started. There's no conditions to determine if it runs or not unless you somehow start one algo from another algo.

If you are starting the algo by clicking the start button itself, and if you don't want a robot to actually do anything until a condition is met, then you need to check that condition in the OnTick method. When the condition is met, then you go to another branch and do what you want.

Example:

protected override void OnTick()

{

   if (! your_condition_is_met)

   {

      ///return or do whatever and wait for the next tick to come through to see if your condition is met

   }

   else //your condition is met

   {

      ///do what you want your bot's algo to do when the conditions are met

   }

 


@firemyst

firemyst
09 Mar 2025, 02:21

How do you expect anyone to help you if you don't describe the errors, or post screen captures of the issues?


@firemyst

firemyst
09 Mar 2025, 02:21

Define “cumbersome”


@firemyst

firemyst
09 Mar 2025, 02:20

POst screen captures showing the issue


@firemyst

firemyst
09 Mar 2025, 02:19

Your best bet is to export to Excel and then use that to sort/filter


@firemyst

firemyst
07 Mar 2025, 00:29

Symbol.PipSize doesn't work for commodities, why? This should be uniform. 

Screen captures, code samples, or other evidence of this demonstrating the issue?

 

When creating a position in CAlgo with a Stop that is perhaps very small, possibly smaller than the spread when the spread is large, the Stop comes out as not set AT ALL. The stop should ALWAYS be set if set in code if the result reports it's successful. 

If you're writing code, your code should also always check if the stop has been set regardless:

TradeResult r = ExecuteMarketOrder(TradeType.Buy, ... blah blah blah);
if (r.IsSuccessful)
{
     Position p = Positions.Find(_positionLabel, s.Name, TradeType.Buy);

    if (p.StopLoss.GetValueOrDefault() == 0)
    {
        Print("WARNING! Stop loss is zero! Why?!");
	//blah blah blah
    }
}

 

If the processor is busy the mouse will stay as crosshairs when going over certain parts of the interface. 

What do you expect it to do? If the processor is busy, it can't do anything. This is an OS issue. 


@firemyst

firemyst
07 Mar 2025, 00:23

The issue is, as stated in a multitude of other posts, that the cloud is broken, and you should use a VPS or run locally.

Spotware has made no mention of it, or that they're investigating/fixing, or something else, with all the user reports of issues with the cloud.

Issues have been ongoing for weeks, and nobody knows their Cloud update schedule.

 


@firemyst

firemyst
07 Mar 2025, 00:20

You haven't described what your bot does.

Maybe you're trying to do something that's not allowed for cbots in the cloud, like sending emails, accessing the internet, drawing things on charts, etc etc.


@firemyst

firemyst
07 Mar 2025, 00:19

Can you post any of the bot's code?

If it's not yours, have you tried contacting the person who developed it?

What do you mean “if I try to use the cbot with another cbot on a different pair”?

Does the cbot have any sort of licensing system that it needs to contact a server on the internet to work?

Are you trying to run it in the cloud or locally?

 


@firemyst

firemyst
07 Mar 2025, 00:16

Where's the rest of your code?

I don't see where you've:

  1. added the timer tick event
  2. what the “check open positions” method does

@firemyst

firemyst
07 Mar 2025, 00:14

Duplicate of /forum/ctrader-algo/46515


@firemyst