Topics
Replies
firemyst
10 Apr 2025, 00:25
You have to use the Positions.Closed event handler to obtain the reason a position was closed. This means you can't really go back in time since the event happens when the position is closed.
Ex:
Positions.Closed += Positions_Closed;
private void Positions_Closed(PositionClosedEventArgs args)
{
Position p1 = args.Position;
//make sure you isolate and get your position since the event method is called for any position that's closed
if (p1.SymbolName == Symbol.Name && p1.Label == _positionLabel)
{
Print("PC06: Position \"{0} {1}\" closed for reason \"{2}\" with {3} profit. ", p1.Id, p1.Label, args.Reason, String.Format("{0:$#,###.00}", p1.GrossProfit));
}
}
@firemyst
firemyst
08 Apr 2025, 05:36
RE: RE: cBot isn`t running
tlauracynthia said:
firemyst said:
And without posting source code that replicates the issue or shows users what you're doing, I don't know how you expect anyone to help.
If I were a software developer, I would. I`m the user, but I know there has to be a bug.
Which is probably on the developer if those bots you're running are custom and not the provided sample bots. So you'll need to speak to whoever you got the bot from.
@firemyst
firemyst
08 Apr 2025, 05:35
RE: RE: Algo bot keep stopping itself since today 7th April
Adro-AI said:
firemyst said:
Do you have any code you can post that reproduces the issue?
It could be your code is doing something you're not aware of, like improper order sizes, or a null reference exception, or something else.
Thanks for the response, I can run the same alg bot with the same script locally. No issue, the local ones are running as normal with no issue. Only the cloud ones causing it.
Do you know if there is a way to retrieve the logs from cloud? Thanks
No there isn't.
However, if it's running locally, I suspect you're doing something in your bot that's not permitted in the cloud. Eg, making an internet connection, sending emails, etc.
@firemyst
firemyst
12 Apr 2025, 02:41
If you would like to see this, then post it in the “Suggestions” forum
@firemyst