Deposits-withdrawals collections / events

Created at 20 Nov 2024, 21:16
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
NC

ncel01

Joined 19.03.2020

Deposits-withdrawals collections / events
20 Nov 2024, 21:16


Hello,

Can traders expect transactions (deposits, withdrawals, etc.) collections and events to be available soon?
Are there any plans to make such info available via API?

I'd need to access this information for risk management purposes.

Thanks.


@ncel01
Replies

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

ncel01
21 Nov 2024, 11:39

RE: Deposits-withdrawals collections / events

firemyst said: 

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.

 

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?

I believe that, at this time, this information should be already accessible via API. After all, this is basic information about any account (trading or not).

Can you think of any account where this information is not available/accessible? I don't.

 


@ncel01

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

ncel01
21 Nov 2024, 13:45

RE: RE: RE: Deposits-withdrawals collections / events

firemyst said: 

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 variabledouble _previousAccountBalance = Account.Balance;//in onTick or whenever, call a method to check your balanceCheckMyBalance();//basic structure for methodprivate 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}}

I also have my own workaround for this.

Workarounds can be done for a lot of situations, which does not mean that certain basic features/properties should not be made available.

It is not that straight forward in my case.

  1. Balance/equity are not only affected by deposit/withdrawals.
  2. Why do you assume that a cBot is running when a deposit/withdrawal takes place?
  3. How to get this info when starting a cBot? Should I store this info in a file?

My workaround:

Comparing the sum of gross P&L for all the closed deals and current P&L with the equity. However, the previous deposit/withdrawal balance is still required as an input.

There's always some kind workaround possible, the question is, why tring to kill an ant with a cannon?

Moreover, withdrawal and deposits are basic properties of an account. It shouldn't be necessary to convince anyone about this.


@ncel01

firemyst
22 Nov 2024, 00:26

RE: RE: RE: RE: Deposits-withdrawals collections / events

ncel01 said: 

 

  1. Balance/equity are not only affected by deposit/withdrawals.

You're initial post only referred to “balance”, not “equity”. 

An account balance either increases in funds available, or decreases. Those could be caused by transfers, positions being closed, or something else. But at the end of the day, an account balance is either going to “increase” or “decrease”, either from funds being deposited into the account, or withdrawn from the account. 

So genuinely asking, what else is “balance” affected by in your situation? 

 

  1. Why do you assume that a cBot is running when a deposit/withdrawal takes place?

I haven't assumed a cbot has to be running when a deposit/withdrawal takes place. 

However, your initial post said you need to access the information via API. Code can only access an API when code is executed. Now, since your post is in the “calgo” forum, which is primarily for bots/indicators/plugins, even by Spotware's own definition: “cTrader Algo is an all-in-one solution that gives users the opportunity to use various automated trading tools including custom indicators, cBots and plugins.”

Couple that with the fact an API can only be access when code is executed, …. that's the reasoning. Whether it's a bot running, or even something simple like dragging/dropping an object on the screen, code has to be executed for an API to be accessed.

If it's for another reason not related to a bot/indicator/plugin, like you're creating your own trading interface or application, or calling a web service or something else, then perhaps you should have posted in either the “Fix API” or “Open API” forums?

 

Moreover, withdrawal and deposits are basic properties of an account. It shouldn't be necessary to convince anyone about this.

No disagreement about this. :-)

I would suggest putting these into the “Suggestions” forum if you want to see Spotware possibly implement them in the future.

 

 


@firemyst

ncel01
23 Nov 2024, 18:33 ( Updated at: 25 Nov 2024, 06:26 )

Dear firemyst,

What did you not understand from my previous reply ?

I welcome every suggestion, however, the way you try to impose your own “solutions” on every case, regardless of its specifics, is just annoying. And this is not the first time.
Is it so hard to accept the evidence? Or a “NO”?

Tip: I suggest that you keep any “hammered” solutions to your projects instead.

I must also say that I have no time to spend on endless/pointless conversations.
So, if, from now on, you can refrain from comment any of my threads that would be appreciated :)

Thanks for your understanding.

You're initial post only referred to “balance”, not “equity”. 

Really? My initial post or your reply to it?
I guess you're a bit confused here.

An account balance either increases in funds available, or decreases. Those could be caused by transfers, positions being closed, or something else. But at the end of the day, an account balance is either going to “increase” or “decrease”, either from funds being deposited into the account, or withdrawn from the account. 

Thanks for the lesson. I feel much more educated in finance now :)
Also, an “end of the day” solution does not fit my needs. Thanks for your understanding.

So genuinely asking, what else is “balance” affected by in your situation? 

That's not relevant since, as I said, an “end of the day” solution does not fit my needs.

I haven't assumed a cbot has to be running when a deposit/withdrawal takes place. 

No, you just provided a piece of code, to “catch” any possible deposits/withdrawals, which will (obviously) only work if a cBot is running.

However, your initial post said you need to access the information via API. Code can only access an API when code is executed. Now, since your post is in the “calgo” forum, which is primarily for bots/indicators/plugins, even by Spotware's own definition: “cTrader Algo is an all-in-one solution that gives users the opportunity to use various automated trading tools including custom indicators, cBots and plugins.”

Couple that with the fact an API can only be access when code is executed, …. that's the reasoning. Whether it's a bot running, or even something simple like dragging/dropping an object on the screen, code has to be executed for an API to be accessed.

If it's for another reason not related to a bot/indicator/plugin, like you're creating your own trading interface or application, or calling a web service or something else, then perhaps you should have posted in either the “Fix API” or “Open API” forums?

Do you want to add something else here, maybe? What about being pragmatic?

I never said I wanted a solution not involving cBots. What I don't want is a “solution” that can be only achieved if/while a cBot is running. Can't you really understand the difference?
I suggest that you read my previous reply, again.

I would suggest putting these into the “Suggestions” forum if you want to see Spotware possibly implement them in the future.

I've already suggested for this, together with some other missing account properties:

https://ctrader.com/forum/suggestions/44392/#post-111643


@ncel01

firemyst
25 Nov 2024, 07:21

RE: Deposits-withdrawals collections / events

 

Do you want to add something else here, maybe? What about being pragmatic?

I never said I wanted a solution not involving cBots. What I don't want is a “solution” that can be only achieved if/while a cBot is running. Can't you really understand the difference?
I suggest that you read my previous reply, again.

 

I do understand the difference perfectly. You haven't specified this requirement until now, so you're handicapping people who are reading and wanting to help. 

Please screen capture your post where you explicitly stated this requirement of not wanting a solution while a cbot is running prior to this response if you believe otherwise. 

It's not here:

 

I don't see anything here indicating you want such a solution:

 

It's not here either. Even after your point 2 below, you haven't clarified. In fact, point 3 you explicitly ask how to get this info when starting a cbot: 

 

And it's not in this response that I'm responding to.

So you're criticizing my replies of not understanding the difference between things, when somehow, you expect me to know all your ‘requirements’ that you haven't clearly stated.

 


@firemyst

ncel01
25 Nov 2024, 12:53 ( Updated at: 25 Nov 2024, 12:55 )

RE: RE: Deposits-withdrawals collections / events

firemyst said: 

 

Do you want to add something else here, maybe? What about being pragmatic?

I never said I wanted a solution not involving cBots. What I don't want is a “solution” that can be only achieved if/while a cBot is running. Can't you really understand the difference?
I suggest that you read my previous reply, again.

 

I do understand the difference perfectly. You haven't specified this requirement until now, so you're handicapping people who are reading and wanting to help. 

Please screen capture your post where you explicitly stated this requirement of not wanting a solution while a cbot is running prior to this response if you believe otherwise. 

It's not here:

 

I don't see anything here indicating you want such a solution:

 

It's not here either. Even after your point 2 below, you haven't clarified. In fact, point 3 you explicitly ask how to get this info when starting a cbot: 

 

And it's not in this response that I'm responding to.

So you're criticizing my replies of not understanding the difference between things, when somehow, you expect me to know all your ‘requirements’ that you haven't clearly stated.

 


Hi again :)

It looks to me that you're making a mountain out of a molehill.

so you're handicapping people who are reading and wanting to help. 

I think that you're handicapping yourself by not accepting the evidence.
Again, I welcome every suggestion. Just try not to impose you own solutions at any cost.

My original post is very explicit as it clearly states all the features/properties I need to achieve a feasible solution in my case.

As you can imagine, I don't have any formula to “shield” my posts against all kinds of (mis)interpretations. 
Should I write a book? Or make a picture out of it, maybe?

Your replies are quite extensive but they don't say a lot. In fact, I still don't know what of the following situations apply.
Can you please clarify so that I can reply accordingly, making it even more clear?

  1. You still didn't understand why the suggestion you provided in your original reply does not suit my needs.
  2. You have understood this and:
    2.1. You agree.
    2.2. You do not agree (please specify exactly why)
    2.3. Other (please specify)
     

Thanks for clarifying the above.
I am (definitely) not into useless/endless conversations and this one is already going to long.


@ncel01