Converting to deposit currency
Converting to deposit currency
05 Mar 2024, 05:45
Hi
I'm currently using AssetConverter.Convert to convert various amounts to my deposit currency. The problem I'm having is that on my broker, for some of their “prime” pairs (designated with a .P suffix, not their normal pairs), my bot freezes when calling .Convert. So instead i just want to do my own calc.
My question is how do I get the exchange rate between the quote currency and the deposit currency?
Thanks
Replies
ctid4921325
06 Mar 2024, 06:24
RE: Converting to deposit currency
PanagiotisCharalampous said:
Hi there,
Can you let us know the broker and share the code that reproduces the problem?
Best regards,
Panagiotis
HI Panagiotis, Thanks for responding. The broker is blackbull nz, after more playing today, it seems that the pairs are their prime JPY pairs, i.e. *JPY.P (USDJPY.P, GBPJPY.P etc).
The code method involved is:
public double AmountAsDepositCurrency(double amount)
{ bool debug=false;
Debug($"Converting deposit currency",debug);
var qAsset=Symbol.QuoteAsset.ToString();
var qa=Assets.GetAsset(qAsset);
Debug($"quote asset: {qAsset}",debug);
var baseAsset=Account.Asset.Name;
var ba=Assets.GetAsset(baseAsset);
Debug($"base asset: {baseAsset}",debug);
return AssetConverter.Convert(amount, qa, ba);
}
The debugging I have around this shows that, when I'm having trouble I don't return from this method.
I don't know if its helpful or not. Most days, I can get around it, but starting up with their regular non-prime USDJPY, then stopping the bot, switching asset, and trying again and repeating till it works (and to be honest I have no idea if that ritual solves the problem or its just random). Other days like today, I just have to not trade JPY.P pairs.
@ctid4921325
ctid4921325
08 Mar 2024, 04:10
RE: RE: Converting to deposit currency
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
@ctid4921325
PanagiotisCharalampous
08 Mar 2024, 08:47
RE: RE: RE: Converting to deposit currency
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
@PanagiotisCharalampous
ctid4921325
11 Mar 2024, 03:28
RE: RE: RE: RE: Converting to deposit currency
PanagiotisCharalampous said:
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
spectacular, thanks so much! Is there away i can work around this in the mean time?
@ctid4921325
PanagiotisCharalampous
11 Mar 2024, 08:56
RE: RE: RE: RE: RE: Converting to deposit currency
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
spectacular, thanks so much! Is there away i can work around this in the mean time?
Unfortunately there is no easy workaround
@PanagiotisCharalampous
ctid4921325
12 Mar 2024, 03:04
RE: RE: RE: RE: RE: RE: Converting to deposit currency
PanagiotisCharalampous said:
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
spectacular, thanks so much! Is there away i can work around this in the mean time?
Unfortunately there is no easy workaround
fair enough, do you have an idea how far out the update is?
@ctid4921325
PanagiotisCharalampous
12 Mar 2024, 06:18
RE: RE: RE: RE: RE: RE: RE: Converting to deposit currency
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
spectacular, thanks so much! Is there away i can work around this in the mean time?
Unfortunately there is no easy workaround
fair enough, do you have an idea how far out the update is?
Unfortunately I do not have an ETA for the update
@PanagiotisCharalampous
ctid4921325
16 Apr 2024, 00:09
RE: RE: RE: RE: RE: RE: RE: RE: Converting to deposit currency
PanagiotisCharalampous said:
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
spectacular, thanks so much! Is there away i can work around this in the mean time?
Unfortunately there is no easy workaround
fair enough, do you have an idea how far out the update is?
Unfortunately I do not have an ETA for the update
Hi Panagiotis, just checking back in and see if there's any sign of this update been released soon, or if you know when?
thanks, Glenn
@ctid4921325
PanagiotisCharalampous
16 Apr 2024, 05:46
RE: RE: RE: RE: RE: RE: RE: RE: RE: Converting to deposit currency
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
PanagiotisCharalampous said:
ctid4921325 said:
In the meantime, does any one know the easiest way to get the exchange rate between quote currency and deposit currency so I can do my own calc and not get blocked by asset converter?
Hi there,
The issue was reproduced and will be fixed in an upcoming update.
Best regards,
Panagiotis
spectacular, thanks so much! Is there away i can work around this in the mean time?
Unfortunately there is no easy workaround
fair enough, do you have an idea how far out the update is?
Unfortunately I do not have an ETA for the update
Hi Panagiotis, just checking back in and see if there's any sign of this update been released soon, or if you know when?
thanks, Glenn
Hi Glenn,
It will be released soon but I do not have a date to provide unfortunately.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Mar 2024, 06:55
Hi there,
Can you let us know the broker and share the code that reproduces the problem?
Best regards,
Panagiotis
@PanagiotisCharalampous