Topics
Replies

firemyst
21 Nov 2024, 12:41

RE: RE: Deposits-withdrawals collections / events

ncel01 said: 

Because I want to be able calculate balance/equity drawdown within certain time frames.

How do you calculate this without any information on the cash flow?

You check the account balance. Set up your own timer event, and check every x minutes/hours. 

Or on every tick or like every 3rd tick that comes in.

And program your bot/indicator to only check within the time frames you want to check.

You have your current account balance. Next time you check, if it increase you know how much came in; if it decreases you know how much went out. That would be your cash flow.

So if your account balance is $10k, and in 3 ticks it's $10.5k, you know $500 came in. What's the difference between that and having a “Deposit event” that was triggered with $500?

//Class variable
double _previousAccountBalance = Account.Balance;

//in onTick or whenever, call a method to check your balance
CheckMyBalance();

//basic structure for method
private void CheckMyBalance()
{
if (Account.Balance > _previousAccountBalance)
{
	///a deposit came in
	//do what you need to
	//taking into account whether or not a position was closed
}
else if (Account.Balance < _previousAccountBalance)
{
	///a withdrawal happened
	//do what you need to
	//taking into account whether or not a position was closed
}
}

 

 


@firemyst

firemyst
21 Nov 2024, 08:18

a push alertc in mobile cTrader app based on this indicator ?

No, it's not possible.

 

or mayby email or smething else ? 

You can write code to have an email sent. Google “calgo send email” and the first result explains how:


@firemyst

firemyst
21 Nov 2024, 08:14

Why not just use the Account.Balance property?

That will have your updated balance which you can use to calculate for risk management purposes, because you'll only be allowed to base your risk management on whatever's in your account anyway.

 


@firemyst

firemyst
18 Nov 2024, 09:27

RE: RE: Inactive Status

PanagiotisCharalampous said: 

firemyst said: 

An example of an even easier method, which I use, is:

if (Symbol.MarketHours.IsOpened())    { // market is open, do what you want }else    { //market is closed for the symbol. Do what you want }

Market hours are different to market sessions. Market hours are set by the broker. Market sessions are global.

Fair point. But the OP said when the market was “open” and didn't specifically mention “market sessions” (although the OP did say “inactive” just as they said “open”). 

So since it was vague to me, I provided another alternative just in case that's what the OP meant.

 


@firemyst

firemyst
18 Nov 2024, 06:16

An example of an even easier method, which I use, is:

if (Symbol.MarketHours.IsOpened())
    { // market is open, do what you want }
else
    { //market is closed for the symbol. Do what you want }

@firemyst

firemyst
17 Nov 2024, 05:04

PLease consider posting what you want to the “Suggestions” forum as this forum is for technical support and won't be looked at by Spotware for suggestions


@firemyst

firemyst
17 Nov 2024, 05:02

Maybe try again and post a picture here when you submit it, especially if it says, “awaiting moderation”.


@firemyst

firemyst
15 Nov 2024, 03:03

This has already been answered if you Google it:


@firemyst

firemyst
14 Nov 2024, 00:08

Seems like you're trying to update the code to the bot while the bot is running as per the error message.

Have you actually:

  1. stopped the running bot
  2. synced/updated the code
  3. then restarted the bot?

you don't say you have in your post, and the error message is clearly stating that you need to.


@firemyst

firemyst
12 Nov 2024, 07:51 ( Updated at: 12 Nov 2024, 08:08 )

Google it, and you come up with this thread. Read until the end:

https://ctrader.com/forum/cbot-support/2177/

 


@firemyst

firemyst
12 Nov 2024, 02:10

RE: ChartTrendLines don't get removed from OnDestroy() method when indicator removed from chart

PanagiotisCharalampous said: 

Hi firemyst,

Thank you for reporting this. We are investigating.

Best regards,

Panagiotis

Any updates on this? Were they able to reproduce the issue?


@firemyst

firemyst
12 Nov 2024, 00:17

Any updates on this issue?


@firemyst

firemyst
11 Nov 2024, 08:30

RE: RE: Bid and Ask Candles

Systex said: 

firemyst said: 

Yes, you are.

First of all, you can choose what lines you want displayed on the chart:

 

Second, if you write your own code, just get the symbol's “ASK” price or “BID” price depending on what you want to display.

eg: Symbol.Ask

 

As the topic says I need Bid and Ask Candles

 

Then as I said, you'll have to write your own code. There is no option to display both bid and ask candles next to each other, or anywhere together, on a chart.


@firemyst

firemyst
10 Nov 2024, 11:53

You need to put this in the “suggestions” forum. 

This is a technical support forum, and Spotware doesn't come here looking for suggestions to improve its product.


@firemyst

firemyst
10 Nov 2024, 01:50

As of this message, no release notes about the 5.0.44 release yet?

What bugs/issues does it supposedly fix?


@firemyst

firemyst
09 Nov 2024, 13:50

If you're programming a bot, use the OnBar() method. 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class ThirdBarMarketOrderBot : Robot
    {
        private int barCount;

        protected override void OnStart()
        {
            barCount = 0;
        }

        protected override void OnBar()
        {
            barCount++;
            Print ("Bar count {0}", barCount);

        }
    }
}

You can find more about it by googling “calgo onbar”


@firemyst

firemyst
09 Nov 2024, 05:56 ( Updated at: 09 Nov 2024, 12:13 )

RE: RE: Two years testing cTrader, and now the troubles of 5.0.40

 

PanagiotisCharalampous said: 

Hi all,

This problem should have been resolved by now. Please restart your cTrader and in case you still experience problems, please send us some troubleshooting information quoting this thread.

Best regards,

Panagiotis

I know you've probably not had the best of weeks but I think Patty's eloquent, insightful and detailed feedback possibly deserved a bit more than your identikit "problem solved" response.  Probably unfair of me considering, but at the very least I hope Spotware takes points on board points 1,2,4 and 5 relating more to development process than any particular bug.

 

In at least the last 7 years I've been on these forums and have seen Panagiotis' responses, I can't recall a time where I've ever seen him do a generic copy/paste of responses like this. Even though it says it's his account, I'm not convinced it's him who actually wrote it. If it is, it's definitely “desperate times, desperate measures” and I'd be a bit disappointed like everyone else. 

That aside, you can tell Spotware must be receiving A LOT of bugs and issue complaints with their release that all they can do to keep up is respond with the generic cookie-cutter response as you indicated.

Surely they must realize by now they are screwing up big time and need to get their act sorted?

 


@firemyst

firemyst
07 Nov 2024, 10:52

Well said overall.

It's quite evident from the string of releases that they have no automated testing procedures in place, nor any dedicated team of testers to review/test releases. 

Way too many of these bugs that have been found and affect the application would have been caught doing basic testing if users are experiencing issues within a day of using the software.

Just look at the recent bug I've reported back in May/June with cBots and it's still not resolved. How can anyone trust cTrader to run any bots when there's a huge known bug that's gone unfixed since at least June?!

If there's any leadership at Spotware, they need to dump their people who are responsible for quality control, and some of their developers who should be doing basic unit tests (and catching these issues) to get some people in there who believe they should actually test their software before releasing to the public.


@firemyst

firemyst
05 Nov 2024, 06:09 ( Updated at: 05 Nov 2024, 08:02 )

Judging from your charts, are you located in the UK?

That “gap” appears to have happened when the markets start their “reset” window, which causes huge spreads.

Because of that, what you obviously need to do is check the spread on the symbol before doing anything.

//Check the spread
if (Symbol.Spread >= SomePredeterminedAmount)   
    Print ("Not doing anything! Spread greater than allowed!");
else
{   
    //Do what you normally would
}

 

The fact it's the spread can also be confirmed by looking at the “tick” chart for the same time - look how the spread suddenly at least quadrupples:


@firemyst

firemyst
05 Nov 2024, 05:46 ( Updated at: 05 Nov 2024, 08:03 )

For Commissions, you can look at these previous threads for guidance:

https://ctrader.com/forum/ctrader-algo/9495/

https://ctrader.com/forum/cbot-support/2395/

 

https://ctrader.com/forum/connect-api-support/37922/

 


@firemyst