Topics
Replies
samyelzallat
12 Nov 2024, 15:00
when I remove onbarclosed from the bot and use onbar it doesn't cause an error
@samyelzallat
samyelzallat
12 Nov 2024, 13:47
My cbot crashes after adding sma to the code and backtesting on 10 and 1 minute bars
[Parameter("Source", Group = "Moving Average")]
public DataSeries SourceSma
{
get;
set;
}
[Parameter("SMA Period", Group = "Moving Average", DefaultValue = 20)]
public int SmaPeriod
{
get;
set;
}
protected override void OnStart()
{
Sma20 = Indicators.SimpleMovingAverage(SourceSma, SmaPeriod);
}
it also works fine with 1 hr time frame, what had me shaking my head is that old bots I made work , but when i copy the exact same code here to a new cbot it doesn't work
@samyelzallat
samyelzallat
04 Nov 2024, 11:56
Hello , I've been experiencing this too for around 3 days now
it happens when Algo tries to sync, it can only do the first sync when you open the software, then is never able to reconnect and gets stuck
The only solution is restarting over and over
@samyelzallat
samyelzallat
22 Oct 2024, 07:06
RE: An issue with multi timeframe code
PanagiotisCharalampous said:
Hi there,
Your indicator only declares two parameters while you are passing three. The code does not make much sense.
Best regards,
Panagiotis
Hey Panagiotis,
But isn't this how it works?
How Do I declare a custom indicator to get data from another tf?
@samyelzallat
samyelzallat
08 Oct 2024, 09:19
( Updated at: 08 Oct 2024, 10:44 )
RE: Modify position isn't working
jeffrey597doss said:
Hello!
It looks like the modify position functions aren’t working as expected. To address this, ensure that GlobalAtrThreshold and GlobalAtrPips are correctly assigned and verify their values through debugging. Check that isTradeActive, IsItLong, and IsItShort flags are set and reset correctly, reflecting the true state of your positions. In the OnTick method, TheDisneyHub ensure the loop iterates correctly and that all conditions for modifying positions are met. Reviewing these variables and conditions should help pinpoint the issue. Does this help clarify things?
Your reply gave so much insight it actually helped,The problem was the way globalatrthreshold is compared to entry pricce, i fixed it so current price for selling eg. - position.Entryprice> threshold, written like that directly in code seemed to work, thanks a lot and have great day
@samyelzallat
samyelzallat
07 Oct 2024, 07:39
( Updated at: 07 Oct 2024, 12:05 )
RE: This Cbot isn't executing Any trades
PanagiotisCharalampous said:
Hi there,
It will be hard to get help by just throwing dozens of lines of code and ask for people why it doesn't work. This is because readers don't know what you expect the code to do and what it does instead. Even if they spend time interrogating you, then they will need to spend hours to figure out what you did wrong in your logic. Not many people have this surplus of time.
Did you try debugging your strategy first? Did you place a break point at the line where the conditions are evaluated to check what are the values when a trade is expected to be placed? It will help you understand why the trade is not placed when you expect it to do so.
You need to narrow down the problem to a question that can be answered by somebody in 10-15 minutes before asking for help.
Best regards,
Panagiotis
Thanks a lot,
I will make an other post with issues Iam still facing and keep it as clear as I can
@samyelzallat
samyelzallat
13 Nov 2024, 11:16 ( Updated at: 13 Nov 2024, 11:22 )
RE: RE: Error | CBot instance crashed with error #ED2F94F3.
PanagiotisCharalampous said:
this will crash until you replace OnBarClosed with OnBar, which I did to have it work
also works with 1hr tf correctly, and it crashes with both fp markets and fusion markets accounts
@samyelzallat