How to place an order on a different scale?
Author: mtowle
Creation Date: 12/7/2017 6:58 PM
profile picture

mtowle

#1
With a custom class derived from WealthScript, how do I place an order from my custom code that analyzes external data?

I want an application to analyze external data and based on that data place Alerts and or Orders in a paper trading account directly or indirectly.

I understand that SM and custom .NET built strategies run based on the scale that has been selected or assigned. So if the scale is set to 5 min then the strategy runes every 5 mins. So one solution might be to create a strategy that is set to a 1 min scale so it runs every one min and the execute procedure would in turn fire off my custom routine that analyzes the external data and if an alert and/or order was to be placed based on that data would create a new order/alert. Is this possible?

Also is it possible to set the scale of a strategy to any scale, 1 min, 60 min, daily, and have my custom .NET strategy have a timer within it that would fire off based on it's frequency and then create any alerts and/or orders within the strategy on it's own timing independent of the strategy's scale?
profile picture

Eugene

#2
QUOTE:
place Alerts and or Orders in a paper trading account directly or indirectly.

It's not supported by us, but you won't be able to place an order indirectly anyway - if this concerns modifying an XML file. Modifications to Wealth-Lab's most XML files (such as those behind the Orders tool) will not be read until WLP is restarted. Other strategies may be writing to the same file.

QUOTE:
...Is this possible?

What's the objective? Please clarify.

QUOTE:
Also is it possible to set the scale of a strategy to any scale, 1 min, 60 min, daily, and have my custom .NET strategy have a timer within it that would fire off based on it's frequency and then create any alerts and/or orders within the strategy on it's own timing independent of the strategy's scale?

No, as there's no intrabar execution as you understand. The process is as simple as timer:

1. A complete bar updates (can be 1-minute, 1-day, etc.)
2. Your strategy executes over all the bars in the chart and determines if it wants to trade on the next bar and places orders for the next bar or not.
profile picture

mtowle

#3
The information you provided gives me better understand of what the WLP namespace can and cannot do and what WLP does specifically so I know it's limitations.

Thanks for the info.
profile picture

Eugene

#4
You're welcome.