- ago
Hi,

Is it possible to use a second informational instrument to take a position?

I have another software that generates signals and I would like to use them within WealthLab. Let me explain:

I call up the history of stock A on date 1 with its forecast on date 2, stock B on date 1 with its forecast on date 2, and so on...

Thanks in advance
Riccardo

0
256
8 Replies

Reply

Bookmark

Jump to End
- ago
#1
Hi Riccardo,

It's certainly possible to accomplish both in C# strategy code and in Building Blocks. Here's a couple of examples for Blocks:

https://www.wealth-lab.com/Discussion/How-to-use-external-symbol-7509
https://www.wealth-lab.com/Discussion/External-symbol-filter-7656
0
- ago
#2
Thanks Eugene,

but I need work with a portfolio backtest and for any symbol I need a specific and different external symbol. Is it possible?

Many thanks
Riccardo
0
Cone8
- ago
#3
Anything is possible.

It's simple logic if you're programming a strategy with C# code. But since you asked the question, I must assume you're working with Building Blocks.

The thing is, you really haven't explained sufficiently how or what the external symbols are used for. Give a precise example, and then we can give you a precise answer.

"I call up the history of stock A on 9/27/2023 with its forecast on 9/28/2023... "
and then what do you do with the "forecast"? What is the "forecast" exactly?
Is it a number value for an indicator, that if exceeded you buy or sell a stock A?
0
- ago
#4
Thanks Cone,

I have just found a solution in building blocks like in image.

The need is :

-buy stock A when the value of A_data_2 cross above value x
-sell stock A when the value of A_data_2 cross under value y

-buy stock B when the value of B_data_2 cross above value x
-sell stock B when the value of B_data_2 cross under value y

and so on... for a portfolio.

I think who is faster in C#, but we are not experts in that language.

Could you give me an example in c#

Thanks a lot
R
0
Cone8
- ago
#5
You started by asking, "Is it possible to use a second informational instrument to take a position?"

A "second instrument" sounds to us like you want to use something like AAPL's RSI to create a trade on MSFT - which is certainly possible, if that's the goal. However, the example text you just gave has nothing to do with that.

When you create trading rules, they're applied to the instrument's "chart data" that under test. When you run a strategy on a portfolio, each instrument has it's own "chart data", whose date range and scale you specify in the Settings. You don't have to add a "using symbol" qualifier unless you want to do the "AAPL -> MSFT" thing.

Examples - there are many in the sample strategies folder installed with WealthLab, and, any Block strategy can be converted to C# code just by clicking that "Open as C#" button at the top.

Also, when testing on a Portfolio, pay attention the Position Sizing. This is the size used for each trade. 100% of Equity Sizing with 1:1 margin will give you only 1 active trade because there won't be any buying power left for other signals.

Read about "NSF Positions" and watch the videos the Help Guide points to.
Also, this a good blog article you should read: Avoid Survivorship Bias with Dynamic DataSets

0
- ago
#6
Thanks Cone,

I'm sorry I misunderstood, but I meant:

"want to do the "AAPL -> MSFT" thing."

Thanks for the tips!

0
- ago
#7
If we were to help you with the C# example, what are the rules of symbol matching in a portfolio? i.e. does the "secondary instrument" (we call this "external symbol") always have a "_data"2" suffix?
0
- ago
#8
Thanks Cone, I saw that. I did as you advised. First I created al strategy with building blocks and then visualized with c#!

Eugene, the suffix is always the "_data2"

Thx
0

Reply

Bookmark

Jump to Top