Send Order To Broker Without Knowing the Symbol
Author: Frank1972
Creation Date: 11/22/2016 9:23 PM
profile picture

Frank1972

#1
Hi,

I'm trying to figure out if I can use WealthLab Pro to send orders to Fidelity for symbols that weren't known when the WealthScript was started? I have a subscription to TradeIdeas that gives me order to take. However, I do not know what the symbol will be until the order arrives. I know that it will be within the set of all symbols traded on NYSE/AMEX and NASDAQ. I wonder if this is possible as I am just trying to enter orders into the market as TradeIdeas gives me the orders.

The attachment "Send Order Generally.PNG" shows a general setup of what I am trying to do. I'm not sure it is fully accurate but I hope that it helps in coming to a correct understanding of what I am trying to do.

The attachment "Send Order Specifically.PNG" shows a more specific setup with a symbol, price, and number of shares.

Thanks,

-Frank
profile picture

sedelstein

#2
Just get Trade Ideas trades into a csv file.
If you can do that the rest is easy
Have WL read the file and generate the Buy / Sell orders.

Use SetContext to the symbol you read from the csv file and issue the order

BuyAtLimit (bar + 1 , limit );


Unless I misunderstood I think this will work. I've used it
profile picture

Frank1972

#3
Sedelstein,

Thanks for the reply!!

I can get Trade-Ideas to come in a csv file. When you say, "Have WL read the file and generate the Buy / Sell order" what WL API would be doing that?

Thanks,

-Frank
profile picture

Eugene

#4
Frank, I'm not familiar with Trade-Ideas. What sort of API do they have?

QUOTE:
When you say, "Have WL read the file and generate the Buy / Sell order" what WL API would be doing that?

Parsing that CSV file directly in your Strategy should be trivial. An example of CSV output would clear things up. Also, we have this solution to import signals for importing both historic trades but I think it might do for live orders as well, creating Alerts:

Import real (historical) trades

profile picture

sedelstein

#5
I would google how to read a csv file in C#. As Eugene said, it is trivial and straightforward C#. StackOverFlow is a good source for C# code.
Good luck
profile picture

Frank1972

#6
Thank you for the responses. I think I understand what your are saying about reading from a CSV. I am a seasoned programmer and know how to open files and parse them with regular expressions etc.

I would like some clarification on how SetContext works. The first parameter is the symbol. Is there a limitation on what symbol can be used? Specifically I want to know if I can use any symbol that Fidelity knows about or am I limited to the symbols in a pre-defined data set when the wealth-script was launched with? For my purpose this is done only during real-time trading. I have no interest in doing this for simulation purposes. So all the data coming in will be real-time and not historical.

Thanks again for all your responses and help,

-Frank
profile picture

Eugene

#7
With on demand data update enabled this could be any Fidelity supported symbol even if it's not present in your DataSets.