Manipulate BuyAtMarket to send multiple orders staggered by time
Author: smiranda
Creation Date: 1/5/2020 11:29 PM
profile picture

smiranda

#1
Is there a way to access the code for WealthLab Pro's built-in functions? I want to try to manipulate the BuyAtMarket function a little but I'm not sure where to find it's code.
profile picture

Eugene

#2
Any part of Wealth-Lab Pro is proprietary Fidelity code (closed source). To manipulate something you'd have to roll out your own BuyAtMarket from scratch.

Question is, what do you think BuyAtMarket lacks? In other words, what's your objective?
profile picture

smiranda

#3
The ultimate goal is to write a strategy that automatically does the following:
Separate into four orders
Each order buys at market price
However the timing of the orders is staggered by a variable amount
profile picture

Eugene

#4
That's why I always ask about the goal. Initial questions and topic titles may be so very distant from it. In this case, it'd be expected to find a feature request because no one is supposed to manipulate the source code (even yours truly). I've renamed the topic title from "Access Wealth-Lab's built-in code to manipulate BuyAtMarket" as accessing the source code really doesn't have to do with it.

Now back to your request. Issuing four orders is a piece of cake. Question is, what do you really mean by staggering the order timing (to different bars I assume)? Why do you think it's required? Depending on your answer we may even drop the 2nd part of topic title ("...manipulate BuyAtMarket"). ;)
profile picture

Cone

#5
The answer is "yes" it can be done, but "how" to do it depends on the workflow that you use and primarily if you are entitled for "Auto-Trade". If you can't Auto-Trade, then the point is moot and you have to click to "Place" orders manually anyway.

Describe your workflow. How are the 4 BuyAtMarket candidates found? When do the orders have to be placed? Go through a specific example, from start to finish.
profile picture

superticker

#6
One other thought. It only makes sense to execute the 2nd, 3rd, etc. buy if there remains more buyers than sellers; otherwise, you would be loosing money buying more. In other words, if there's only a "slight" pull back after a buy, then execute the next buy; otherwise, if there's a large pull back, then don't execute anymore buys. So future buys should come with conditions.

I'm assuming you're testing if there are more buyers than sellers before making the first buy--that's a given. The question is, "Does it stay that way for the next buy?"
profile picture

smiranda

#7
Hello,

The buy price is manually determined. It cannot be coded. Once the buy point is determined, then we would like to split up the buy order into 4 tranches with a quarter each of the account balance and a variable discount to the initial buy price.

I can do this with a calculator and manually put in the ticket , but sometimes the moves are faster than I can calculate.
profile picture

Eugene

#8
Again, how is the timing of the orders staggered by a variable amount?
profile picture

smiranda

#9
The timing is manual not automated. I decide the specific price for the order ticket
profile picture

Eugene

#10
Given that Wealth-Lab is a mechanical trading application, in the end this doesn't make a lot of sense to me (if any):

QUOTE:
The ultimate goal is to write a strategy that automatically does the following:
(...)
The timing is manual not automated.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).