forked from QuantConnect/Lean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuantConnect-Platform-2.0.0.yaml
2271 lines (2154 loc) · 73.7 KB
/
QuantConnect-Platform-2.0.0.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
description: "QuantConnect Platform API controls creating, updating and deleting projects, files, backtests and live algorithms. Automate the updating and backtesting of your strategies, or build tools to fast track your development."
version: 2.0.0
title: QuantConnect Platform API v2.0
termsOfService: 'https://www.quantconnect.com/terms'
contact:
name: QuantConnect
email: [email protected]
license:
name: License For Use Granted Under QuantConnect Terms of Service.
servers:
- url: 'https://www.quantconnect.com/api/v2'
description: 'Primary REST Endpoint'
#
# Authentication is base64 encoding of {userId}:sha256{token:unixtimestamp}
# Timestamp must be within the last 20 seconds.
#
security:
- nonceTokenAuth: []
#
# URL Paths for API
#
paths:
# Create a new project or return error
'/projects/create':
post:
summary: 'Create a project with the specified name and language. If the project already exists return false with exception details in the errors array.'
tags:
- Project Management
requestBody:
description: 'Name and language of the project to create.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProjectRequest'
responses:
'200':
$ref: '#/components/responses/ProjectListResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Read details about a single project, or list details of all projects.
'/projects/read':
post:
summary: 'If a ReadProjectRequest is passed, get details about that single project. If no request body is passed, list details of all projects.'
tags:
- Project Management
requestBody:
description: 'The projectId for the project to read, or nothing to get a list of all projects.'
required: False
content:
application/json:
schema:
$ref: '#/components/schemas/ReadProjectRequest'
responses:
'200':
$ref: '#/components/responses/ProjectListResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Update a project name or details
'/projects/update':
post:
summary: 'Update a project name, description or parameters.'
tags:
- Project Management
requestBody:
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateProjectRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Delete a specific project
'/projects/delete':
post:
summary: 'Delete a project.'
tags:
- Project Management
requestBody:
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteProjectRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Add a file to a project.
'/files/create':
post:
summary: 'Add a file to given project.'
tags:
- File Management
requestBody:
description: 'Project, file name and file content to create'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProjectFileRequest'
responses:
'200':
$ref: '#/components/responses/ProjectFilesResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Read one file or multiple files in a project.
'/files/read':
post:
summary: 'If a ReadSingleFileRequest is passed, reads that file from the project. If a ReadAllFilesRequest is passed, reads all files in the project.'
tags:
- File Management
requestBody:
description: 'An array list of files from the project requested.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/ReadFilesRequest'
responses:
'200':
$ref: '#/components/responses/ProjectFilesResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Update the name of a file, or update the contents of a file.
'/files/update':
post:
summary: 'If an UpdateProjectFileNameRequest is passed, update the name of a file. If a UpdateProjectFileContentsRequest is passed, update the contents of a file.'
tags:
- File Management
requestBody:
description: 'Information about the file to update along with the new properties to set.'
required: True
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/UpdateFileNameRequest'
- $ref: '#/components/schemas/UpdateFileContentsRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Delete a file in a project.
'/files/delete':
post:
summary: 'Delete a file in a project'
tags:
- File Management
requestBody:
description: 'Project Id and filename to specify the file for deletion.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteFileRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Create a new compile job request for a project
'/compile/create':
post:
summary: 'Asynchronously create a compile job request for a project'
tags:
- Compiling Code
requestBody:
description: 'Project Id specifying project to build.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCompileRequest'
responses:
'200':
$ref: '#/components/responses/CompileResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Read a compile packet job result
'/compile/read':
post:
summary: 'Read a compile packet job result.'
tags:
- Compiling Code
requestBody:
description: 'Read a compile result for a specific Project Id and Compile Id.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/ReadCompileRequest'
responses:
'200':
$ref: '#/components/responses/CompileResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Create a new backtest request and get the id
'/backtests/create':
post:
summary: 'Create a new backtest request and get the backtest Id.'
tags:
- Backtest Management
requestBody:
description: 'Create a new backtest given a project Id and compile Id.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/CreateBacktestRequest'
responses:
'200':
$ref: '#/components/responses/BacktestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Read one or multiple backtests from the project
'/backtests/read':
post:
summary: 'If a backtest id is provided, read out that backtest from the project, otherwise list all the backtests for the project.'
tags:
- Backtest Management
requestBody:
description: 'Fetch the results for the project Id and backtest Id provided.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/ReadBacktestRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
oneOf:
- $ref: '#/components/responses/BacktestResponse'
- $ref: '#/components/responses/BacktestList'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Read out the report of a backtest
'/backtests/read/report':
post:
summary: 'Read out the report of a backtest in the project id specified'
tags:
- Backtest Management
requestBody:
description: 'A JSON object containing info about the project to delete.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/BacktestReportRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
oneOf:
- $ref: '#/components/responses/BacktestReport'
- $ref: '#/components/responses/RequestFailedError'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Update a backtest name
'/backtests/update':
post:
summary: 'Update a backtest name or note'
tags:
- Backtest Management
requestBody:
description: 'A JSON object containing info about the backtest and new name.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateBacktestRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Delete a backtest
'/backtests/delete':
post:
summary: 'Delete a backtest from the specified project and backtestId'
tags:
- Backtest Management
requestBody:
description: 'Information required to delete the backtest.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteBacktestRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Create a live Algorithm
'/live/create':
post:
summary: 'Create a live algorithm'
tags:
- Live Management
requestBody:
description: 'Project, compile and brokerage login information for deploying a live algorithm.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/CreateLiveAlgorithmRequest'
responses:
'200':
$ref: '#/components/responses/LiveAlgorithm'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Read out a live algorithm or get a list of live running algorithms
'/live/read':
post:
summary: 'If a ReadLiveAlgorithmRequest is provided details on a live algorithm are returned. If a ListLiveAlgorithmsRequest is passed get a list of live running algorithms.'
tags:
- Live Management
requestBody:
description: 'Dynamic arguement to specify whether seeking single project or list response.'
required: True
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/ReadLiveAlgorithmRequest'
- $ref: '#/components/schemas/ListLiveAlgorithmsRequest'
responses:
'200':
description: OK
content:
application/json:
schema:
oneOf:
- $ref: '#/components/responses/LiveAlgorithmResults'
- $ref: '#/components/responses/LiveList'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Liquidate a live algorithm from a project
'/live/update/liquidate':
post:
summary: 'Liquidate a live algorithm from the specified project and deployId.'
tags:
- Live Management
requestBody:
description: 'Information about the live algorithm to liquidate.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/LiquidateLiveAlgorithmRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Stop a live algorithm
'/live/update/stop':
post:
summary: 'Stop a live algorithm from the specified project and deployId.'
tags:
- Live Management
requestBody:
description: 'Information about the project to delete.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/StopLiveAlgorithmRequest'
responses:
'200':
$ref: '#/components/responses/RestResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Get the logs of a specific live algorithm
'/live/read/log':
post:
summary: 'Get the logs of a specific live algorithm.'
tags:
- Live Management
requestBody:
description: 'Information about the algorithm to read live logs from.'
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/ReadLiveLogsRequest'
responses:
'200':
$ref: '#/components/responses/ReadLiveLogsResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Get the link to downloadable data
'/data/read':
post:
summary: 'Get the link to the downloadable data.'
tags:
- Downloading Data
requestBody:
required: True
content:
application/json:
schema:
$ref: '#/components/schemas/DataDownloadRequest'
responses:
'200':
$ref: '#/components/responses/ReadDataLinkResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Model Definitions
components:
# Base API Security ->
securitySchemes:
nonceTokenAuth:
description: 'The standard QuantConnect API authentication scheme is used. This requires the current unixtime and your api key to be hashed together with SHA256 and sent as the B64 password in a basic authentication. The username for the basic authentication is the UID on your QuantConnect account.'
type: http
scheme: basic
responses:
BacktestResponse:
description: 'Backtest read response packet.'
content:
application/json:
schema:
$ref: '#/components/schemas/BacktestResponse'
BacktestList:
description: 'Collection container for a list of backtests for a project.'
content:
application/json:
schema:
$ref: '#/components/schemas/BacktestList'
BacktestReport:
description: 'Backtest Report Response wrapper.'
content:
application/json:
schema:
$ref: '#/components/schemas/BacktestReport'
CompileResponse:
description: 'Response from the compiler on a build event.'
content:
application/json:
schema:
$ref: '#/components/schemas/CompileResponse'
LiveAlgorithm:
description: 'Live algorithm instance result.'
content:
application/json:
schema:
$ref: '#/components/schemas/LiveAlgorithm'
LiveAlgorithmLog:
description: 'Logs from a live algorithm.'
content:
application/json:
schema:
$ref: '#/components/schemas/LiveAlgorithmLogs'
LiveAlgorithmList:
description: 'List of the live algorithms running which match the requested status.'
content:
application/json:
schema:
$ref: '#/components/schemas/LiveAlgorithmList'
LiveAlgorithmResults:
description: 'Details a live algorithm from the live/read API endpoint.'
content:
application/json:
schema:
$ref: '#/components/schemas/LiveAlgorithmResults'
LiveList:
description: 'List of the live algorithms running which match the requested status.'
content:
application/json:
schema:
$ref: '#/components/schemas/LiveList'
ProjectListResponse:
description: 'Project list response.'
content:
application/json:
schema:
$ref: '#/components/schemas/ProjectListResponse'
ProjectFilesResponse:
description: 'Response received when reading all files of a project.'
content:
application/json:
schema:
$ref: '#/components/schemas/ProjectFilesResponse'
# Response from reading purchased data
ReadDataLinkResponse:
description: 'Response from reading purchased data.'
content:
application/json:
schema:
$ref: '#/components/schemas/ReadDataLinkResponse'
ReadLiveLogsResponse:
description: 'Logs from a live algorithm.'
content:
application/json:
schema:
$ref: '#/components/schemas/ReadLiveLogsResponse'
RequestFailedError:
description: 'Request Failed.'
content:
application/json:
schema:
$ref: '#/components/schemas/RequestFailedError'
RestResponse:
description: 'Base API response class.'
content:
application/json:
schema:
$ref: '#/components/schemas/RestResponse'
UnauthorizedError:
description: 'Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.'
headers:
www_authenticate:
schema:
type: string
schemas:
AlgorithmPerformance:
description: 'The AlgorithmPerformance class is a wrapper for TradeStatistics and PortfolioStatistics.'
type: object
properties:
TradeStatistics:
$ref: '#/components/schemas/TradeStatistics'
PortfolioStatistics:
$ref: '#/components/schemas/PortfolioStatistics'
ClosedTrades:
description: 'The algorithm statistics on portfolio.'
type: array
items:
$ref: '#/components/schemas/Trade'
AlgorithmStatus:
description: 'States of a live deployment.'
type: string
enum:
- 'DeployError'
- 'InQueue'
- 'Running'
- 'Stopped'
- 'Liquidated'
- 'Deleted'
- 'Completed'
- 'RuntimeError'
- 'Invalid'
- 'LoggingIn'
- 'Initializing'
- 'History'
AlphaRuntimeStatistics:
description: 'Contains insight population run time statistics.'
type: object
properties:
MeanPopulationScore:
$ref: '#/components/schemas/InsightScore'
RollingAveragedPopulationScore:
$ref: '#/components/schemas/InsightScore'
LongCount:
description: 'Gets the total number of insights with an up direction.'
type: string
ShortCount:
description: 'Gets the total number of insights with a down direction.'
type: string
LongShortRatio:
description: 'The ratio of InsightDirection.Up over InsightDirection.Down'
type: number
format: float
TotalAccumulatedEstimatedAlphaValue:
description: 'The total accumulated estimated value of trading all insights.'
type: number
format: float
KellyCriterionEstimate:
description: "Score of the strategy's insights predictive power."
type: number
format: float
KellyCriterionProbabilityValue:
description: 'The p-value or probability value of the KellyCriterionEstimate.'
type: number
format: float
FitnessScore:
description: "Score of the strategy's performance, and suitability for the Alpha Stream Market."
type: number
format: float
PortfolioTurnover:
description: 'Measurement of the strategies trading activity with respect to the portfolio value. Calculated as the sales volume with respect to the average total portfolio value.'
type: number
format: float
ReturnOverMaxDrawdown:
description: 'Provides a risk adjusted way to factor in the returns and drawdown of the strategy. It is calculated by dividing the Portfolio Annualized Return by the Maximum Drawdown seen during the backtest.'
type: number
format: float
SortinoRatio:
description: "Gives a relative picture of the strategy volatility. It is calculated by taking a portfolio's annualized rate of return and subtracting the risk free rate of return."
type: number
format: float
EstimatedMonthlyAlphaValue:
description: 'Suggested Value of the Alpha On A Monthly Basis For Licensing.'
type: number
format: float
TotalInsightsGenerated:
description: 'The total number of insight signals generated by the algorithm.'
type: string
TotalInsightsClosed:
description: 'The total number of insight signals generated by the algorithm.'
type: string
TotalInsightsAnalysisCompleted:
description: 'The total number of insight signals generated by the algorithm.'
type: string
MeanPopulationEstimatedInsightValue:
description: 'Gets the mean estimated insight value.'
type: number
format: float
BacktestResponse:
description: 'Packet container for carrying Backtest results.'
type: object
properties:
name:
type: string
description: 'Name of the backtest.'
note:
type: string
description: 'Note on the backtest attached by the user.'
backtestId:
type: string
description: 'Assigned backtest Id'
completed:
type: boolean
description: 'Boolean true when the backtest is completed.'
progress:
type: number
format: float
description: 'Progress of the backtest in percent 0-1'
result:
$ref: '#/components/schemas/BacktestResult'
error:
type: string
description: 'Backtest error message.'
stacktrace:
type: string
description: 'Backtest error stacktrace.'
created:
type: string
format: date-time
description: 'Backtest creation date and time.'
success:
type: boolean
description: 'Indicate if the API request was successful.'
errors:
type: array
items:
type: string
description: 'List of errors with the API call.'
BacktestList:
description: 'Collection container for a list of Backtest objects for a project.'
type: object
properties:
backtests:
type: array
items:
$ref: '#/components/schemas/BacktestResponse'
description: 'Array of BacktestResponse objects'
success:
type: boolean
description: 'Indicate if the API request was successful.'
errors:
type: array
items:
type: string
description: 'List of errors with the API call.'
BacktestReport:
description: 'Backtest Report Response wrapper.'
type: object
properties:
report:
description: 'HTML data of the report with embedded base64 images.'
type: string
success:
type: boolean
description: 'Indicate if the API request was successful.'
errors:
type: array
items:
type: string
description: 'List of errors with the API call.'
BacktestReportRequest:
description: 'Request to read out the report of a backtest.'
type: object
properties:
projectId:
description: 'Id of the project to read.'
type: integer
backtestId:
description: 'Specific backtest Id to read.'
type: string
BacktestResult:
description: 'Results object class. Results are exhaust from backtest or live algorithms running in LEAN.'
type: object
properties:
RollingWindow:
type: object
additionalProperties:
$ref: '#/components/schemas/AlgorithmPerformance'
description: 'Rolling window detailed statistics.'
TotalPerformance:
$ref: '#/components/schemas/AlgorithmPerformance'
AlphaRuntimeStatistics:
$ref: '#/components/schemas/AlphaRuntimeStatistics'
Charts:
type: object
additionalProperties:
$ref: '#/components/schemas/Chart'
description: 'Charts updates for the live algorithm since the last result packet.'
Orders:
type: object
additionalProperties:
$ref: '#/components/schemas/Order'
description: 'Order updates since the last result packet.'
OrderEvents:
type: array
items:
$ref: '#/components/schemas/OrderEvent'
description: 'OrderEvent updates since the last result packet.'
ProfitLoss:
type: object
additionalProperties:
type: number
format: float
description: 'Trade profit and loss information since the last algorithm result packet.'
Statistics:
type: object
additionalProperties:
type: string
description: 'Statistics information sent during the algorithm operations.'
RuntimeStatistics:
type: object
additionalProperties:
type: string
description: 'Runtime banner/updating statistics in the title banner of the live algorithm GUI.'
ServerStatistics:
type: object
additionalProperties:
type: string
description: 'Server status information, including CPU and RAM usage.'
BaseLiveAlgorithmSettings:
description: 'Base class for settings that must be configured per Brokerage to create new algorithms via the API.'
type: object
properties:
id:
description: "'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'"
type: string
user:
description: 'Username associated with brokerage.'
type: string
password:
description: 'Password associated with brokerage.'
type: string
environment:
$ref: '#/components/schemas/BrokerageEnvironment'
account:
description: 'Account of the associated brokerage.'
type: string
BrokerageEnvironment:
description: 'Represents the types of environments supported by brokerages for trading.'
type: string
enum:
- 'live'
- 'paper'
Cash:
description: 'Represents a holding of a currency in cash.'
type: object
properties:
_conversionRate:
description: 'Conversion rate for this cash.'
type: number
format: float
_isBaseCurrency:
description: 'Is this the base account currency of the cashbook.'
type: boolean
_invertRealTimePrice:
description: 'Invert real time price.'
type: boolean
Symbol:
description: 'Gets the symbol used to represent this cash.'
type: string
Amount:
description: 'Gets or sets the amount of cash held.'
type: number
format: float
CurrencySymbol:
description: 'The symbol of the currency, such as $.'
CashAmount:
description: 'Represents a cash amount which can be converted to account currency using a currency converter.'
properties:
Amount:
description: 'The amount of cash.'
type: number
format: float
Currency:
description: 'The currency in which the cash amount is denominated.'
type: string
CashBook:
description: 'Keeps track of the different cash holdings of an algorithm. Is also a Dictionary of Cash objects.'
type: object
properties:
_accountCurrency:
description: 'The base currency used.'
type: string
_currencies:
description: 'Tracks cash holdings.'
type: object
additionalProperties:
$ref: '#/components/schemas/Cash'
TotalValueInAccountCurrency:
description: 'The total value of the cash book in units of the base currency.'
type: number
format: float
AccountCurrency:
description: 'Gets account currency.'
type: string
additionalProperties:
$ref: '#/components/schemas/Cash'
Chart:
description: 'Single Parent Chart Object for Custom Charting.'
type: object
properties:
Name:
description: 'Name of the Chart.'
type: string
ChartType:
description: 'Type of the Chart, Overlayed or Stacked.'
type: string
enum:
- "Overlay"
- "Stacked"
Series:
description: 'List of Series Objects for this Chart.'
type: object
additionalProperties:
$ref: '#/components/schemas/Series'
ChartPoint:
description: 'Location on a chart containing the X-Y location'
type: object
properties:
x:
description: 'Time of this chart point: lower case for javascript encoding simplicty.'
type: string
y:
description: 'Value of this chart point: lower case for javascript encoding simplicty.'
type: number
format: float
CreateCompileRequest:
description: 'Request to compile a project.'
type: object
properties:
projectId:
description: 'Project id we wish to compile.'
type: integer
CompileResponse:
description: 'Response from the compiler on a build event.'
type: object
properties:
compileId:
type: string
description: 'Compile Id for a sucessful build.'
state:
type: string
enum:
- "InQueue"
- "BuildSuccess"
- "BuildError"
description: 'True on successful compile.'
logs:
type: array
items:
type: string
description: 'Logs of the compilation request.'
success:
type: boolean
description: 'Indicate if the API request was successful.'
errors:
type: array
items:
type: string
description: 'List of errors with the API call.'
CreateBacktestRequest:
description: 'Request to create a new backtest.'
type: object
properties:
projectId:
description: 'Project Id we sent for compile.'
type: integer
compileId:
description: 'Compile Id for the project to backtest.'
type: string
backtestName:
description: 'Name for the new backtest.'
type: string
CreateLiveAlgorithmRequest:
description: 'Request to create a live algorithm.'
type: object
properties:
projectId:
description: 'Project Id.'
type: integer
compileId:
description: 'Compile Id.'
type: string
serverType:
description: 'Type of server instance that will run the algorithm.'
type: string
baseLiveAlgorithmSettings:
$ref: '#/components/schemas/BaseLiveAlgorithmSettings'
versionId:
description: 'The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use.'
type: string
example: "-1"
CreateProjectRequest:
description: 'Request to create a project.'
type: object
properties:
name:
description: 'Project name.'
type: string
language:
description: 'Programming langage to use.'
type: string
enum:
- "C#"