Topics
Replies
firemyst
22 Jan 2025, 00:20
( Updated at: 22 Jan 2025, 10:05 )
I am interested in whether it is possible to make a code to reset the bot itself after each closed position?
Yes. When a position is closed, just reset all your internal parameters/properties. for instance, if you have a counter, reset it to zero; if you have some sort of “flag”, reset it to its default value; if you have any objects, reinitialize as appropriate.
Second, is it possible to reset the bot after a loss and enter the next position with a 4x bigger lot?
Yes. In your bot's code, when a position is closed, check to see if it did for a loss.
If it did lose, then update your position-size parameter value as appropriate.
In simplistic terms. Obviously the complexity of the implementation will depend on how clean your code is.
@firemyst
firemyst
21 Jan 2025, 23:30
( Updated at: 22 Jan 2025, 10:05 )
RE: RE: RE: Error | Crashed in OnBar with TypeLoadException...
oliver.r.m.92 said:
oliver.r.m.92 said:
firemyst said:
Have you tried updating the cTrader.Automate package to the latest version?
I think not, how can I do it?
I found the information here "https://help.ctrader.com/ctrader-algo/visual-studio-ides/#creating-new-cbotsindicators" but I did not use Visual studio to create the cBot, does it also affect its operation?
If you created the bot and have the source code, you need to post the code where the error is occurring. Otherwise, it's hard for anyone to help you because they can't see what your code is doing. It shouldn't matter whether you use visual studio or another development environment.
If you didn't create the bot and/or do not have access to the source code, then it's probably easiest to contact the bot's developer.
@firemyst
firemyst
21 Jan 2025, 23:21
RE: RE: Manage bots from the android mobile app
gianluca.balzamo said:
firemyst said:
A question or statement?
I think it wouod be great to be able to manage bots from the app. Even if only few functionalities like turning it on/off and changing some settings.
Then you should post this in the suggestions forum. This forum is for technical support - Spotware doesn't come here looking for ways to improve its product
@firemyst
firemyst
20 Jan 2025, 00:38
( Updated at: 21 Jan 2025, 21:08 )
You can fix it.
It's exactly as the error message says – you're missing a parameter which specifies the “ProtectionType”.
The code compiles and should still run at the moment.
@Spotware has yet to provide any documentation or responses to people who have posted and asked what the new ProtectionType parameter is about, or does:
https://community.ctrader.com/forum/cbot-support/46002/
https://community.ctrader.com/forum/ctrader-algo/46005/
https://community.ctrader.com/forum/ctrader-algo/45988/
@firemyst
firemyst
20 Jan 2025, 00:31
( Updated at: 21 Jan 2025, 21:08 )
Hi there:
Great job with the indicator! It's one I like to use as well.
As for your issue - don't draw a rectangle. Instead, make the rectangles a “trendline”. Same height, but use a thickness of 4 or 5 instead of 1 (to show the body). The width will expand equally in both directions.
Keep your “wicks” trendline exactly as they are.
So the “body” will be a thick trendline, which is how I did mine.
It'll be the easiest unless you want to do something fancier with the rectangles.
If you want to stick with the rectangles, try something along the lines of the following. I'm not sure if it will work, but worth trying:
Rectangle r = Chart.DrawRectangle(...);
r.HorizontalAlignment = HorizontalAlignment.Center;
@firemyst
firemyst
15 Jan 2025, 05:44
( Updated at: 21 Jan 2025, 21:07 )
Two things to try possibly:
- Close down your cTrader and when it's closed, go into Windows Task manager | Details tab to verify there are no instances running under ctrader.exe. If there are, kill them.
- If that doesn't work, try going into General Settings and click the button that says, “Reset Local Data to Default”. Make note of any special settings you have as that could reset them.
@firemyst
firemyst
14 Jan 2025, 03:24
( Updated at: 21 Jan 2025, 21:07 )
The SL functionality in cTrader isn't “conditional” – eg, only trail if the next bar closes higher - with orders.
You'll have to program it in.
On every new bar, check your conditions if the previous bar is higher than the bar before it.
If so, go through the tick data and call the api to set your SL. I don't use tick data, so I don't know how you qualify “10 ticks below the current high” as the 10th tick could be closer to the high than the 7th or 8th tick.
@firemyst
firemyst
12 Jan 2025, 04:01
( Updated at: 21 Jan 2025, 21:07 )
RE: RE: Error | Crashed in OnBar with TypeLoadException...
oliver.r.m.92 said:
firemyst said:
Have you tried updating the cTrader.Automate package to the latest version?
I think not, how can I do it?
https://help.ctrader.com/ctrader-algo/visual-studio-ides/#creating-new-cbotsindicators
@firemyst
firemyst
22 Jan 2025, 00:21 ( Updated at: 22 Jan 2025, 10:05 )
Spotware needs you to post this in the suggestions forum. Maybe with a link to an example.
This is tech support forum – they don't come here looking for suggestions for their product.
Or you can code it yourself.
@firemyst