Topics
Replies

firemyst
14 Apr 2025, 10:11

Why aren't you setting the SL before placing a market order?


@firemyst

firemyst
13 Apr 2025, 23:59

RE: RE: OnPendingOrders Events are not triggered

eynt said: 

What about the StopLoss/TaleProfit orders?

Stop loss orders trigger a market order when a designated price is hit (eg, their line is touched). 

This is how most (if not all) brokers implement them.


@firemyst

firemyst
13 Apr 2025, 13:02

RE: RE: Lots vs Units

 

Now my problem is I bought 1 lot of US100 then I close partial volume using this code

double volume = 0.5;ModifyVolume(volume)

it says Bad Volume.

But when I close .5 lot using a normal close, I mean not using a bot, it accepted it.

 

Post your code. For all I know, your code could have done something else, or reduced the size already before, or you could be using the wrong position or something else.


@firemyst

firemyst
13 Apr 2025, 06:04

Did you ask your broker why?


@firemyst

firemyst
13 Apr 2025, 06:03

Where's the image?


@firemyst

firemyst
13 Apr 2025, 06:03

Where's the image?


@firemyst

firemyst
13 Apr 2025, 06:02

Did you check your margin levels? 

What error was reported that you couldn't open? DId you try asking your broker?


@firemyst

firemyst
13 Apr 2025, 05:57

PLease post in Suggestions forum. This is not where Spotware comes looking for suggestions to improve their product - it's for technical support.


@firemyst

firemyst
12 Apr 2025, 02:51

Why should there be prints?

Your code executes a “market order”; your print statements are for “Pending Orders”. 

Market Orders and Pending Orders are not the same.

You need to Google if you don't understand the differences.


@firemyst

firemyst
12 Apr 2025, 02:48

Is lot and unit the same?

Not always. Depends on what you're trading.

For forex pairs, 1 lot = 100,000 units.


@firemyst

firemyst
12 Apr 2025, 02:41

If you would like to see this, then post it in the “Suggestions” forum


@firemyst

firemyst
12 Apr 2025, 02:37

Duplicate:

/forum/ctrader-support/46838/


@firemyst

firemyst
10 Apr 2025, 13:07

If you're using calgo, you can calculate it yourself depending on how you want to calculate it.


@firemyst

firemyst
10 Apr 2025, 13:07

It would be more handy to post your suggestion in the “Suggestions” forum where Spotware actually goes looking for suggestions :-)


@firemyst

firemyst
10 Apr 2025, 00:26

Duplicate. 

See this thread:

/forum/ctrader-algo/46822/

 


@firemyst

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, 09:58

Nope.

At least not yet.


@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
07 Apr 2025, 23:46

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.


@firemyst