- ago


For one of my strategy I use BTC as base currency at Binance.
The calculation of the shares is wrong because WL assumes that I use a monetary currency to buy.
Elsewhere we had already clarified that this does not work because WL cannot work with multiple currencies.

Now I work in such a way that I export all data from "Quotes" to Excel and calculate the correct quantiy there. This is still relatively simple. But what is annoying is that I have to manually change the value every morning for 30 signals.
Is there an easier way, perhaps a way to import from Excel?


0
531
Solved
5 Replies

Reply

Bookmark

Sort
Cone8
 ( 25.05% )
- ago
#1
If you have a calculation, just put it in the Strategy code and assign it to the Transaction like this -

CODE:
            Transaction t = PlaceTrade(bars, TransactionType.Buy, OrderType.Market);             t.Quantity = (some_calculated_quantity);
0
Best Answer
- ago
#2
I am only now getting around to looking at the subject again. At the moment I have the following procedure every morning:
-Export the signals (stop entry) to Excel.
-There I enter the current balance in the currency BTC in a table.
-Then 5% of this balance is assigned to each signal.
-I then manually overwrite this value in quotes (30 signals).
-Then I activate Auto-Place in Quotes.

Is there a method in C# how I can possibly enter the current banalce in BTC in the code and from this the quantity is calculated correctly.
This way, I would no longer need the diversions via Excel.





0
- ago
#3
Of course, it would be great if this could be completely automated.
One problem is that signals that are triggered overnight after 00:00 do not take place in WL because it is a new day.
Conversely, I miss signals after 00:00 until I start work.
I then convert the missed ones into limit orders, which are sometimes triggered and sometimes not.
So I don't reach the exact state of WL.
Again, I need Excel to manage the positions that did not take place in WL.
WL is a valuable help in this case, but not the machine that does all the work.
I am in the process of learning C# to get a better handle on this.

0
- ago
#4
QUOTE:
Is there a method in C# how I can possibly enter the current banalce in BTC in the code and from this the quantity is calculated correctly.

While you can't override the current equity with an arbitrary figure, what you could do is follow Cone's Post #1 and calculate the quantity according to your BTC based equity.
0
Cone8
 ( 25.05% )
- ago
#5
If you haven't already, you need to add your vote to this feature request so that Strategies can access account values - https://www.wealth-lab.com/Discussion/7914 (Add your thumbs up in the starter post.)

Since you can't access account values currently, the solution is the same as I gave you in your C2 question, and essentially what Eugene just said - edit the strategy with the account value to use in your calculation.

If you prefer, you could keep a file that your strategies access, but either way, you need to make an edit. Since account values don't usually change in a significant way each day, I think it's probably easiest just to edit these values in your strategies each weekend.
0

Reply

Bookmark

Sort