-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strategy with multi Charts #88
Comments
Hi Ahmad, The MovingAverage strategy and it's corresponding UI logic is there to provide an example that can be followed when creating your own custom strategy and corresponding view. A quick option would be to clone it and replace the implementation details with your own custom code. The code can be found in the following projects:
|
Great, thank you very much. I have another question, is it possible to have robot trader? You know, I want to have bot to trade features in binance. If you have any suggestion, that will be nice. |
The strategy runs on the TradeServer independently of the UI, which means it can act like a 'bot'. You can create a custom strategy to subscribe to real-time trade feeds, order book, candlestick (if available), statistics and account details and real-time open orders etc. The custom strategy can be configured to run against a specified exchange (e.g. Binance) and you can provide an api key, secret key and, depending on the exchange, an optional pass phrase (e.g. pass phrase is required by Kucoin but not Binance). This will give the strategy access to the account and the ability to place or cancel orders based on your own custom logic i.e. based on real-time decisions your custom logic makes from the feeds the strategy has subscribed to. Currently Binance and Kucoin API's are supported however, you can extend this to any exchange or add new features an exchange supports. The TradeView UI simply allows you to do the following:
Note, if you launch a strategy from the UI, you can close the UI and the strategy will continue to run on the TradeServer. You can also free to write your own custom app for launching a strategy. To do this you will need to understand how the TradeServer works. |
To run a strategy you will need to do the following:
My recommendation is you first get the demo "Moving Average Strategy" working running then you can use that as a template for creating your own. Here I will share some more information about each of the steps above. 1. Configure a strategyConfiguration -> Manage Strategies The top group box, Strategy Runner, is for configuring the strategy that is run on the trade server, where:
The bottom group box, Strategy Display, is for configuring the WPF component to monitor the strategy is real time (this is what gets rendered in the area that empty in your second screenshot above):
2. Configure a trade serverConfiguration -> Manage Trade Servers 3. Run the Trade Server console applicationThis is DevelopmentInProgress.TradeServer.Console application. Have a look at its Program.cs file and note the args which includes the uri and instance name, which is configured in step 2. above. Also look at the Startup.cs in DevelopmentInProgress.TradeServer.StrategyExecution.WebHost to see how the args are used. 4. Start running a strategy from the Trade Viewer WPF applicationRun the Trade Viewer WPF application click on the Strategies Module in the navigation panel and select the strategy. Set some Breakpoints and step through to see how it all worksBreakpoint 1 - Run Strategy buttonPut a breakpoint behind the Run Strategy button at await httpClient.PostAsync(uri, multipartFormDataContent, cancellationToken).ConfigureAwait(false); Breakpoint 2 - Inside the trade server MiddlewarePut a breakpoint in the RunStrategyMiddleware of the trade servers DevelopmentInProgress.TradeServer.StrategyExecution.WebHost to see the incoming request to run the strategy. Step through and you will see the strategy assemblies loaded into memory and the strategy is executed. Breakpoint 3 - Inside the MovingAverageStrategyPut a breakpoint inside the Once the demo strategy is working you should see something like: |
@overstartup here are some additional suggestions to help you get the demo "Moving Average Strategy" running. If you are running Visual Studio: Set the output path for each project to In the solution's properties, setting the following as startup projects so both the server and WPF app launch at startup.
Here are some default config files. You will need to place the config files in the same folder the binaries are output to e.g. REPLACE_WITH_YOUR_USER_NAME_Accounts.txt The config file names starts with your login username so you will need to rename them to be picked up. var userAccountsFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{Environment.UserName}_Accounts.txt");
var userStrategiesFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{Environment.UserName}_Strategies.txt");
var userServersFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{Environment.UserName}_TradeServers.txt"); Note: the config is set to run the strategy against Binance however, to get started you don't need to have a Binance account as the demo strategy doesn't actually place live orders. Let me know how you get on. |
Thank you very much. i will try it |
Hi Grant Colley,
I need help to create new strategy, well I need to use 4 EMA, 1 HMA ,MACD and fibo charts in this strategy. Could you please tell me how I can do that?
Is it possible to create the logic and view?
The text was updated successfully, but these errors were encountered: