pinescript-mcp 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. pinescript_mcp/__init__.py +7 -0
  2. pinescript_mcp/__main__.py +6 -0
  3. pinescript_mcp/docs/LLM_MANIFEST.md +96 -0
  4. pinescript_mcp/docs/concepts/colors_and_display.md +574 -0
  5. pinescript_mcp/docs/concepts/common_errors.md +550 -0
  6. pinescript_mcp/docs/concepts/execution_model.md +1059 -0
  7. pinescript_mcp/docs/concepts/methods.md +543 -0
  8. pinescript_mcp/docs/concepts/objects.md +349 -0
  9. pinescript_mcp/docs/concepts/timeframes.md +73 -0
  10. pinescript_mcp/docs/pine_v6_functions.json +488 -0
  11. pinescript_mcp/docs/reference/annotations.md +229 -0
  12. pinescript_mcp/docs/reference/constants.md +1694 -0
  13. pinescript_mcp/docs/reference/functions/collections.md +2793 -0
  14. pinescript_mcp/docs/reference/functions/drawing.md +1082 -0
  15. pinescript_mcp/docs/reference/functions/general.md +1892 -0
  16. pinescript_mcp/docs/reference/functions/request.md +232 -0
  17. pinescript_mcp/docs/reference/functions/strategy.md +1517 -0
  18. pinescript_mcp/docs/reference/functions/ta.md +1225 -0
  19. pinescript_mcp/docs/reference/keywords.md +487 -0
  20. pinescript_mcp/docs/reference/operators.md +311 -0
  21. pinescript_mcp/docs/reference/pine_v6_cheatsheet.md +183 -0
  22. pinescript_mcp/docs/reference/types.md +405 -0
  23. pinescript_mcp/docs/reference/variables.md +2272 -0
  24. pinescript_mcp/docs/visuals/backgrounds.md +110 -0
  25. pinescript_mcp/docs/visuals/bar_coloring.md +35 -0
  26. pinescript_mcp/docs/visuals/bar_plotting.md +93 -0
  27. pinescript_mcp/docs/visuals/colors.md +574 -0
  28. pinescript_mcp/docs/visuals/fills.md +497 -0
  29. pinescript_mcp/docs/visuals/levels.md +91 -0
  30. pinescript_mcp/docs/visuals/lines_and_boxes.md +1252 -0
  31. pinescript_mcp/docs/visuals/overview.md +563 -0
  32. pinescript_mcp/docs/visuals/plots.md +390 -0
  33. pinescript_mcp/docs/visuals/tables.md +207 -0
  34. pinescript_mcp/docs/visuals/texts_and_shapes.md +862 -0
  35. pinescript_mcp/docs/writing_scripts/debugging.md +1943 -0
  36. pinescript_mcp/docs/writing_scripts/limitations.md +457 -0
  37. pinescript_mcp/docs/writing_scripts/profiling_and_optimization.md +2016 -0
  38. pinescript_mcp/docs/writing_scripts/publishing_scripts.md +327 -0
  39. pinescript_mcp/docs/writing_scripts/style_guide.md +245 -0
  40. pinescript_mcp/server.py +570 -0
  41. pinescript_mcp-0.1.0.dist-info/METADATA +121 -0
  42. pinescript_mcp-0.1.0.dist-info/RECORD +45 -0
  43. pinescript_mcp-0.1.0.dist-info/WHEEL +4 -0
  44. pinescript_mcp-0.1.0.dist-info/entry_points.txt +2 -0
  45. pinescript_mcp-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1694 @@
1
+ # Constants
2
+ ---
3
+
4
+ ## adjustment.dividends
5
+
6
+ **Type:** const string
7
+
8
+ Constant for dividends adjustment type (dividends adjustment is applied).
9
+
10
+ ---
11
+
12
+ ## adjustment.none
13
+
14
+ **Type:** const string
15
+
16
+ Constant for none adjustment type (no adjustment is applied).
17
+
18
+ ---
19
+
20
+ ## adjustment.splits
21
+
22
+ **Type:** const string
23
+
24
+ Constant for splits adjustment type (splits adjustment is applied).
25
+
26
+ ---
27
+
28
+ ## alert.freq_all
29
+
30
+ **Type:** const string
31
+
32
+ A named constant for use with the freq parameter of the alert() function.
33
+
34
+ ---
35
+
36
+ ## alert.freq_once_per_bar
37
+
38
+ **Type:** const string
39
+
40
+ A named constant for use with the freq parameter of the alert() function.
41
+
42
+ ---
43
+
44
+ ## alert.freq_once_per_bar_close
45
+
46
+ **Type:** const string
47
+
48
+ A named constant for use with the freq parameter of the alert() function.
49
+
50
+ ---
51
+
52
+ ## backadjustment.inherit
53
+
54
+ **Type:** const backadjustment
55
+
56
+ A constant to specify the value of the backadjustment parameter in ticker.new and ticker.modify functions.
57
+
58
+ ---
59
+
60
+ ## backadjustment.off
61
+
62
+ **Type:** const backadjustment
63
+
64
+ A constant to specify the value of the backadjustment parameter in ticker.new and ticker.modify functions.
65
+
66
+ ---
67
+
68
+ ## backadjustment.on
69
+
70
+ **Type:** const backadjustment
71
+
72
+ A constant to specify the value of the backadjustment parameter in ticker.new and ticker.modify functions.
73
+
74
+ ---
75
+
76
+ ## barmerge.gaps_off
77
+
78
+ **Type:** const barmerge_gaps
79
+
80
+ Merge strategy for requested data. Data is merged continuously without gaps, all the gaps are filled with the previous nearest existing value.
81
+
82
+ ---
83
+
84
+ ## barmerge.gaps_on
85
+
86
+ **Type:** const barmerge_gaps
87
+
88
+ Merge strategy for requested data. Data is merged with possible gaps (na values).
89
+
90
+ ---
91
+
92
+ ## barmerge.lookahead_off
93
+
94
+ **Type:** const barmerge_lookahead
95
+
96
+ Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their close time. This merge strategy disables effect of getting data from "future" on calculation on history.
97
+
98
+ ---
99
+
100
+ ## barmerge.lookahead_on
101
+
102
+ **Type:** const barmerge_lookahead
103
+
104
+ Merge strategy for the requested data position. Requested barset is merged with current barset in the order of sorting bars by their opening time. This merge strategy can lead to undesirable effect of getting data from "future" on calculation on history. This is unacceptable in backtesting strategies, but can be useful in indicators.
105
+
106
+ ---
107
+
108
+ ## color.aqua
109
+
110
+ **Type:** const color
111
+
112
+ Is a named constant for #00BCD4 color.
113
+
114
+ ---
115
+
116
+ ## color.black
117
+
118
+ **Type:** const color
119
+
120
+ Is a named constant for #363A45 color.
121
+
122
+ ---
123
+
124
+ ## color.blue
125
+
126
+ **Type:** const color
127
+
128
+ Is a named constant for #2962ff color.
129
+
130
+ ---
131
+
132
+ ## color.fuchsia
133
+
134
+ **Type:** const color
135
+
136
+ Is a named constant for #E040FB color.
137
+
138
+ ---
139
+
140
+ ## color.gray
141
+
142
+ **Type:** const color
143
+
144
+ Is a named constant for #787B86 color.
145
+
146
+ ---
147
+
148
+ ## color.green
149
+
150
+ **Type:** const color
151
+
152
+ Is a named constant for #4CAF50 color.
153
+
154
+ ---
155
+
156
+ ## color.lime
157
+
158
+ **Type:** const color
159
+
160
+ Is a named constant for #00E676 color.
161
+
162
+ ---
163
+
164
+ ## color.maroon
165
+
166
+ **Type:** const color
167
+
168
+ Is a named constant for #880E4F color.
169
+
170
+ ---
171
+
172
+ ## color.navy
173
+
174
+ **Type:** const color
175
+
176
+ Is a named constant for #311B92 color.
177
+
178
+ ---
179
+
180
+ ## color.olive
181
+
182
+ **Type:** const color
183
+
184
+ Is a named constant for #808000 color.
185
+
186
+ ---
187
+
188
+ ## color.orange
189
+
190
+ **Type:** const color
191
+
192
+ Is a named constant for #FF9800 color.
193
+
194
+ ---
195
+
196
+ ## color.purple
197
+
198
+ **Type:** const color
199
+
200
+ Is a named constant for #9C27B0 color.
201
+
202
+ ---
203
+
204
+ ## color.red
205
+
206
+ **Type:** const color
207
+
208
+ Is a named constant for #F23645 color.
209
+
210
+ ---
211
+
212
+ ## color.silver
213
+
214
+ **Type:** const color
215
+
216
+ Is a named constant for #B2B5BE color.
217
+
218
+ ---
219
+
220
+ ## color.teal
221
+
222
+ **Type:** const color
223
+
224
+ Is a named constant for #089981 color.
225
+
226
+ ---
227
+
228
+ ## color.white
229
+
230
+ **Type:** const color
231
+
232
+ Is a named constant for #FFFFFF color.
233
+
234
+ ---
235
+
236
+ ## color.yellow
237
+
238
+ **Type:** const color
239
+
240
+ Is a named constant for #FDD835 color.
241
+
242
+ ---
243
+
244
+ ## currency.AUD
245
+
246
+ **Type:** const string
247
+
248
+ Australian dollar.
249
+
250
+ ---
251
+
252
+ ## currency.BTC
253
+
254
+ **Type:** const string
255
+
256
+ Bitcoin.
257
+
258
+ ---
259
+
260
+ ## currency.CAD
261
+
262
+ **Type:** const string
263
+
264
+ Canadian dollar.
265
+
266
+ ---
267
+
268
+ ## currency.CHF
269
+
270
+ **Type:** const string
271
+
272
+ Swiss franc.
273
+
274
+ ---
275
+
276
+ ## currency.EGP
277
+
278
+ **Type:** const string
279
+
280
+ Egyptian pound.
281
+
282
+ ---
283
+
284
+ ## currency.ETH
285
+
286
+ **Type:** const string
287
+
288
+ Ethereum.
289
+
290
+ ---
291
+
292
+ ## currency.EUR
293
+
294
+ **Type:** const string
295
+
296
+ Euro.
297
+
298
+ ---
299
+
300
+ ## currency.GBP
301
+
302
+ **Type:** const string
303
+
304
+ Pound sterling.
305
+
306
+ ---
307
+
308
+ ## currency.HKD
309
+
310
+ **Type:** const string
311
+
312
+ Hong Kong dollar.
313
+
314
+ ---
315
+
316
+ ## currency.INR
317
+
318
+ **Type:** const string
319
+
320
+ Indian rupee.
321
+
322
+ ---
323
+
324
+ ## currency.JPY
325
+
326
+ **Type:** const string
327
+
328
+ Japanese yen.
329
+
330
+ ---
331
+
332
+ ## currency.KRW
333
+
334
+ **Type:** const string
335
+
336
+ South Korean won.
337
+
338
+ ---
339
+
340
+ ## currency.MYR
341
+
342
+ **Type:** const string
343
+
344
+ Malaysian ringgit.
345
+
346
+ ---
347
+
348
+ ## currency.NOK
349
+
350
+ **Type:** const string
351
+
352
+ Norwegian krone.
353
+
354
+ ---
355
+
356
+ ## currency.NONE
357
+
358
+ **Type:** const string
359
+
360
+ Unspecified currency.
361
+
362
+ ---
363
+
364
+ ## currency.NZD
365
+
366
+ **Type:** const string
367
+
368
+ New Zealand dollar.
369
+
370
+ ---
371
+
372
+ ## currency.PKR
373
+
374
+ **Type:** const string
375
+
376
+ Pakistani rupee.
377
+
378
+ ---
379
+
380
+ ## currency.PLN
381
+
382
+ **Type:** const string
383
+
384
+ Polish zloty.
385
+
386
+ ---
387
+
388
+ ## currency.RUB
389
+
390
+ **Type:** const string
391
+
392
+ Russian ruble.
393
+
394
+ ---
395
+
396
+ ## currency.SEK
397
+
398
+ **Type:** const string
399
+
400
+ Swedish krona.
401
+
402
+ ---
403
+
404
+ ## currency.SGD
405
+
406
+ **Type:** const string
407
+
408
+ Singapore dollar.
409
+
410
+ ---
411
+
412
+ ## currency.TRY
413
+
414
+ **Type:** const string
415
+
416
+ Turkish lira.
417
+
418
+ ---
419
+
420
+ ## currency.USD
421
+
422
+ **Type:** const string
423
+
424
+ United States dollar.
425
+
426
+ ---
427
+
428
+ ## currency.USDT
429
+
430
+ **Type:** const string
431
+
432
+ Tether.
433
+
434
+ ---
435
+
436
+ ## currency.ZAR
437
+
438
+ **Type:** const string
439
+
440
+ South African rand.
441
+
442
+ ---
443
+
444
+ ## dayofweek.friday
445
+
446
+ **Type:** const int
447
+
448
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
449
+
450
+ ---
451
+
452
+ ## dayofweek.monday
453
+
454
+ **Type:** const int
455
+
456
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
457
+
458
+ ---
459
+
460
+ ## dayofweek.saturday
461
+
462
+ **Type:** const int
463
+
464
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
465
+
466
+ ---
467
+
468
+ ## dayofweek.sunday
469
+
470
+ **Type:** const int
471
+
472
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
473
+
474
+ ---
475
+
476
+ ## dayofweek.thursday
477
+
478
+ **Type:** const int
479
+
480
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
481
+
482
+ ---
483
+
484
+ ## dayofweek.tuesday
485
+
486
+ **Type:** const int
487
+
488
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
489
+
490
+ ---
491
+
492
+ ## dayofweek.wednesday
493
+
494
+ **Type:** const int
495
+
496
+ Is a named constant for return value of dayofweek function and value of dayofweek variable.
497
+
498
+ ---
499
+
500
+ ## display.all
501
+
502
+ **Type:** const plot_simple_display
503
+
504
+ A named constant for use with the display parameter of plot*() and input*() functions. Displays plotted or input values in all possible locations.
505
+
506
+ ---
507
+
508
+ ## display.data_window
509
+
510
+ **Type:** const plot_display
511
+
512
+ A named constant for use with the display parameter of plot*() and input*() functions. Displays plotted or input values in the Data Window, a menu accessible from the chart's right sidebar.
513
+
514
+ ---
515
+
516
+ ## display.none
517
+
518
+ **Type:** const plot_simple_display
519
+
520
+ A named constant for use with the display parameter of plot*() and input*() functions. plot*() functions using this will not display their plotted values anywhere. However, alert template messages and fill functions can still use the values, and they will appear in exported chart data. input*() functions using this constant will only display their values within the script's settings.
521
+
522
+ ---
523
+
524
+ ## display.pane
525
+
526
+ **Type:** const plot_display
527
+
528
+ A named constant for use with the display parameter of plot*() functions. Displays plotted values in the chart pane used by the script.
529
+
530
+ ---
531
+
532
+ ## display.price_scale
533
+
534
+ **Type:** const plot_display
535
+
536
+ A named constant for use with the display parameter of plot*() functions. Displays the plot’s label and value on the price scale if the chart's settings allow it.
537
+
538
+ ---
539
+
540
+ ## display.status_line
541
+
542
+ **Type:** const plot_display
543
+
544
+ A named constant for use with the display parameter of plot*() and input*() functions. Displays plotted or input values in the status line next to the script's name on the chart if the chart's settings allow it.
545
+
546
+ ---
547
+
548
+ ## dividends.gross
549
+
550
+ **Type:** const string
551
+
552
+ A named constant for the request.dividends function. Is used to request the dividends return on a stock before deductions.
553
+
554
+ ---
555
+
556
+ ## dividends.net
557
+
558
+ **Type:** const string
559
+
560
+ A named constant for the request.dividends function. Is used to request the dividends return on a stock after deductions.
561
+
562
+ ---
563
+
564
+ ## earnings.actual
565
+
566
+ **Type:** const string
567
+
568
+ A named constant for the request.earnings function. Is used to request the earnings value as it was reported.
569
+
570
+ ---
571
+
572
+ ## earnings.estimate
573
+
574
+ **Type:** const string
575
+
576
+ A named constant for the request.earnings function. Is used to request the estimated earnings value.
577
+
578
+ ---
579
+
580
+ ## earnings.standardized
581
+
582
+ **Type:** const string
583
+
584
+ A named constant for the request.earnings function. Is used to request the standardized earnings value.
585
+
586
+ ---
587
+
588
+ ## extend.both
589
+
590
+ **Type:** const string
591
+
592
+ A named constant for line.new and line.set_extend functions.
593
+
594
+ ---
595
+
596
+ ## extend.left
597
+
598
+ **Type:** const string
599
+
600
+ A named constant for line.new and line.set_extend functions.
601
+
602
+ ---
603
+
604
+ ## extend.none
605
+
606
+ **Type:** const string
607
+
608
+ A named constant for line.new and line.set_extend functions.
609
+
610
+ ---
611
+
612
+ ## extend.right
613
+
614
+ **Type:** const string
615
+
616
+ A named constant for line.new and line.set_extend functions.
617
+
618
+ ---
619
+
620
+ ## false
621
+
622
+ Literal representing a bool value, and result of a comparison operation.
623
+
624
+ ### Remarks
625
+ See the User Manual for comparison operators and logical operators.
626
+
627
+ ---
628
+
629
+ ## font.family_default
630
+
631
+ **Type:** const string
632
+
633
+ Default text font for box.new, box.set_text_font_family, label.new, label.set_text_font_family, table.cell and table.cell_set_text_font_family functions.
634
+
635
+ ---
636
+
637
+ ## font.family_monospace
638
+
639
+ **Type:** const string
640
+
641
+ Monospace text font for box.new, box.set_text_font_family, label.new, label.set_text_font_family, table.cell and table.cell_set_text_font_family functions.
642
+
643
+ ---
644
+
645
+ ## format.inherit
646
+
647
+ **Type:** const string
648
+
649
+ Is a named constant for selecting the formatting of the script output values from the parent series in the indicator function.
650
+
651
+ ---
652
+
653
+ ## format.mintick
654
+
655
+ **Type:** const string
656
+
657
+ Is a named constant to use with the str.tostring function. Passing a number to str.tostring with this argument rounds the number to the nearest value that can be divided by syminfo.mintick, without the remainder, with ties rounding up, and returns the string version of said value with trailing zeros.
658
+
659
+ ---
660
+
661
+ ## format.percent
662
+
663
+ **Type:** const string
664
+
665
+ Is a named constant for selecting the formatting of the script output values as a percentage in the indicator function. It adds a percent sign after values.
666
+
667
+ ### Remarks
668
+ The default precision is 2, regardless of the precision of the chart itself. This can be changed with the 'precision' argument of the indicator function.
669
+
670
+ ---
671
+
672
+ ## format.price
673
+
674
+ **Type:** const string
675
+
676
+ Is a named constant for selecting the formatting of the script output values as prices in the indicator function.
677
+
678
+ ### Remarks
679
+ If format is format.price, default precision value is set. You can use the precision argument of indicator function to change the precision value.
680
+
681
+ ---
682
+
683
+ ## format.volume
684
+
685
+ **Type:** const string
686
+
687
+ Is a named constant for selecting the formatting of the script output values as volume in the indicator function, e.g. '5183' will be formatted as '5.183K'.
688
+
689
+ ---
690
+
691
+ ## hline.style_dashed
692
+
693
+ **Type:** const hline_style
694
+
695
+ Is a named constant for dashed linestyle of hline function.
696
+
697
+ ---
698
+
699
+ ## hline.style_dotted
700
+
701
+ **Type:** const hline_style
702
+
703
+ Is a named constant for dotted linestyle of hline function.
704
+
705
+ ---
706
+
707
+ ## hline.style_solid
708
+
709
+ **Type:** const hline_style
710
+
711
+ Is a named constant for solid linestyle of hline function.
712
+
713
+ ---
714
+
715
+ ## label.style_arrowdown
716
+
717
+ **Type:** const string
718
+
719
+ Label style for label.new and label.set_style functions.
720
+
721
+ ---
722
+
723
+ ## label.style_arrowup
724
+
725
+ **Type:** const string
726
+
727
+ Label style for label.new and label.set_style functions.
728
+
729
+ ---
730
+
731
+ ## label.style_circle
732
+
733
+ **Type:** const string
734
+
735
+ Label style for label.new and label.set_style functions.
736
+
737
+ ---
738
+
739
+ ## label.style_cross
740
+
741
+ **Type:** const string
742
+
743
+ Label style for label.new and label.set_style functions.
744
+
745
+ ---
746
+
747
+ ## label.style_diamond
748
+
749
+ **Type:** const string
750
+
751
+ Label style for label.new and label.set_style functions.
752
+
753
+ ---
754
+
755
+ ## label.style_flag
756
+
757
+ **Type:** const string
758
+
759
+ Label style for label.new and label.set_style functions.
760
+
761
+ ---
762
+
763
+ ## label.style_label_center
764
+
765
+ **Type:** const string
766
+
767
+ Label style for label.new and label.set_style functions.
768
+
769
+ ---
770
+
771
+ ## label.style_label_down
772
+
773
+ **Type:** const string
774
+
775
+ Label style for label.new and label.set_style functions.
776
+
777
+ ---
778
+
779
+ ## label.style_label_left
780
+
781
+ **Type:** const string
782
+
783
+ Label style for label.new and label.set_style functions.
784
+
785
+ ---
786
+
787
+ ## label.style_label_lower_left
788
+
789
+ **Type:** const string
790
+
791
+ Label style for label.new and label.set_style functions.
792
+
793
+ ---
794
+
795
+ ## label.style_label_lower_right
796
+
797
+ **Type:** const string
798
+
799
+ Label style for label.new and label.set_style functions.
800
+
801
+ ---
802
+
803
+ ## label.style_label_right
804
+
805
+ **Type:** const string
806
+
807
+ Label style for label.new and label.set_style functions.
808
+
809
+ ---
810
+
811
+ ## label.style_label_up
812
+
813
+ **Type:** const string
814
+
815
+ Label style for label.new and label.set_style functions.
816
+
817
+ ---
818
+
819
+ ## label.style_label_upper_left
820
+
821
+ **Type:** const string
822
+
823
+ Label style for label.new and label.set_style functions.
824
+
825
+ ---
826
+
827
+ ## label.style_label_upper_right
828
+
829
+ **Type:** const string
830
+
831
+ Label style for label.new and label.set_style functions.
832
+
833
+ ---
834
+
835
+ ## label.style_none
836
+
837
+ **Type:** const string
838
+
839
+ Label style for label.new and label.set_style functions.
840
+
841
+ ---
842
+
843
+ ## label.style_square
844
+
845
+ **Type:** const string
846
+
847
+ Label style for label.new and label.set_style functions.
848
+
849
+ ---
850
+
851
+ ## label.style_text_outline
852
+
853
+ **Type:** const string
854
+
855
+ Label style for label.new and label.set_style functions.
856
+
857
+ ---
858
+
859
+ ## label.style_triangledown
860
+
861
+ **Type:** const string
862
+
863
+ Label style for label.new and label.set_style functions.
864
+
865
+ ---
866
+
867
+ ## label.style_triangleup
868
+
869
+ **Type:** const string
870
+
871
+ Label style for label.new and label.set_style functions.
872
+
873
+ ---
874
+
875
+ ## label.style_xcross
876
+
877
+ **Type:** const string
878
+
879
+ Label style for label.new and label.set_style functions.
880
+
881
+ ---
882
+
883
+ ## line.style_arrow_both
884
+
885
+ **Type:** const string
886
+
887
+ Line style for line.new and line.set_style functions. Solid line with arrows on both points.
888
+
889
+ ---
890
+
891
+ ## line.style_arrow_left
892
+
893
+ **Type:** const string
894
+
895
+ Line style for line.new and line.set_style functions. Solid line with arrow on the first point.
896
+
897
+ ---
898
+
899
+ ## line.style_arrow_right
900
+
901
+ **Type:** const string
902
+
903
+ Line style for line.new and line.set_style functions. Solid line with arrow on the second point.
904
+
905
+ ---
906
+
907
+ ## line.style_dashed
908
+
909
+ **Type:** const string
910
+
911
+ Line style for line.new and line.set_style functions.
912
+
913
+ ---
914
+
915
+ ## line.style_dotted
916
+
917
+ **Type:** const string
918
+
919
+ Line style for line.new and line.set_style functions.
920
+
921
+ ---
922
+
923
+ ## line.style_solid
924
+
925
+ **Type:** const string
926
+
927
+ Line style for line.new and line.set_style functions.
928
+
929
+ ---
930
+
931
+ ## location.abovebar
932
+
933
+ **Type:** const string
934
+
935
+ Location value for plotshape, plotchar functions. Shape is plotted above main series bars.
936
+
937
+ ---
938
+
939
+ ## location.absolute
940
+
941
+ **Type:** const string
942
+
943
+ Location value for plotshape, plotchar functions. Shape is plotted on chart using indicator value as a price coordinate.
944
+
945
+ ---
946
+
947
+ ## location.belowbar
948
+
949
+ **Type:** const string
950
+
951
+ Location value for plotshape, plotchar functions. Shape is plotted below main series bars.
952
+
953
+ ---
954
+
955
+ ## location.bottom
956
+
957
+ **Type:** const string
958
+
959
+ Location value for plotshape, plotchar functions. Shape is plotted near the bottom chart border.
960
+
961
+ ---
962
+
963
+ ## location.top
964
+
965
+ **Type:** const string
966
+
967
+ Location value for plotshape, plotchar functions. Shape is plotted near the top chart border.
968
+
969
+ ---
970
+
971
+ ## math.e
972
+
973
+ **Type:** const float
974
+
975
+ Is a named constant for Euler's number. It is equal to 2.7182818284590452.
976
+
977
+ ---
978
+
979
+ ## math.phi
980
+
981
+ **Type:** const float
982
+
983
+ Is a named constant for the golden ratio. It is equal to 1.6180339887498948.
984
+
985
+ ---
986
+
987
+ ## math.pi
988
+
989
+ **Type:** const float
990
+
991
+ Is a named constant for Archimedes' constant. It is equal to 3.1415926535897932.
992
+
993
+ ---
994
+
995
+ ## math.rphi
996
+
997
+ **Type:** const float
998
+
999
+ Is a named constant for the golden ratio conjugate. It is equal to 0.6180339887498948.
1000
+
1001
+ ---
1002
+
1003
+ ## order.ascending
1004
+
1005
+ **Type:** const sort_order
1006
+
1007
+ Determines the sort order of the array from the smallest to the largest value.
1008
+
1009
+ ---
1010
+
1011
+ ## order.descending
1012
+
1013
+ **Type:** const sort_order
1014
+
1015
+ Determines the sort order of the array from the largest to the smallest value.
1016
+
1017
+ ---
1018
+
1019
+ ## plot.style_area
1020
+
1021
+ **Type:** const plot_style
1022
+
1023
+ A named constant for the 'Area' style, to be used as an argument for the style parameter in the plot function.
1024
+
1025
+ ---
1026
+
1027
+ ## plot.style_areabr
1028
+
1029
+ **Type:** const plot_style
1030
+
1031
+ A named constant for the 'Area With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_area, except the gaps in the data are not filled.
1032
+
1033
+ ---
1034
+
1035
+ ## plot.style_circles
1036
+
1037
+ **Type:** const plot_style
1038
+
1039
+ A named constant for the 'Circles' style, to be used as an argument for the style parameter in the plot function.
1040
+
1041
+ ---
1042
+
1043
+ ## plot.style_columns
1044
+
1045
+ **Type:** const plot_style
1046
+
1047
+ A named constant for the 'Columns' style, to be used as an argument for the style parameter in the plot function.
1048
+
1049
+ ---
1050
+
1051
+ ## plot.style_cross
1052
+
1053
+ **Type:** const plot_style
1054
+
1055
+ A named constant for the 'Cross' style, to be used as an argument for the style parameter in the plot function.
1056
+
1057
+ ---
1058
+
1059
+ ## plot.style_histogram
1060
+
1061
+ **Type:** const plot_style
1062
+
1063
+ A named constant for the 'Histogram' style, to be used as an argument for the style parameter in the plot function.
1064
+
1065
+ ---
1066
+
1067
+ ## plot.style_line
1068
+
1069
+ **Type:** const plot_style
1070
+
1071
+ A named constant for the 'Line' style, to be used as an argument for the style parameter in the plot function.
1072
+
1073
+ ---
1074
+
1075
+ ## plot.style_linebr
1076
+
1077
+ **Type:** const plot_style
1078
+
1079
+ A named constant for the 'Line With Breaks' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_line, except the gaps in the data are not filled.
1080
+
1081
+ ---
1082
+
1083
+ ## plot.style_stepline
1084
+
1085
+ **Type:** const plot_style
1086
+
1087
+ A named constant for the 'Step Line' style, to be used as an argument for the style parameter in the plot function.
1088
+
1089
+ ---
1090
+
1091
+ ## plot.style_stepline_diamond
1092
+
1093
+ **Type:** const plot_style
1094
+
1095
+ A named constant for the 'Step Line With Diamonds' style, to be used as an argument for the style parameter in the plot function. Similar to plot.style_stepline, except the data changes are also marked with the Diamond shapes.
1096
+
1097
+ ---
1098
+
1099
+ ## plot.style_steplinebr
1100
+
1101
+ **Type:** const plot_style
1102
+
1103
+ A named constant for the 'Step line with Breaks' style, to be used as an argument for the style parameter in the plot function.
1104
+
1105
+ ---
1106
+
1107
+ ## position.bottom_center
1108
+
1109
+ **Type:** const string
1110
+
1111
+ Table position is used in table.new, table.cell functions.
1112
+
1113
+ ---
1114
+
1115
+ ## position.bottom_left
1116
+
1117
+ **Type:** const string
1118
+
1119
+ Table position is used in table.new, table.cell functions.
1120
+
1121
+ ---
1122
+
1123
+ ## position.bottom_right
1124
+
1125
+ **Type:** const string
1126
+
1127
+ Table position is used in table.new, table.cell functions.
1128
+
1129
+ ---
1130
+
1131
+ ## position.middle_center
1132
+
1133
+ **Type:** const string
1134
+
1135
+ Table position is used in table.new, table.cell functions.
1136
+
1137
+ ---
1138
+
1139
+ ## position.middle_left
1140
+
1141
+ **Type:** const string
1142
+
1143
+ Table position is used in table.new, table.cell functions.
1144
+
1145
+ ---
1146
+
1147
+ ## position.middle_right
1148
+
1149
+ **Type:** const string
1150
+
1151
+ Table position is used in table.new, table.cell functions.
1152
+
1153
+ ---
1154
+
1155
+ ## position.top_center
1156
+
1157
+ **Type:** const string
1158
+
1159
+ Table position is used in table.new, table.cell functions.
1160
+
1161
+ ---
1162
+
1163
+ ## position.top_left
1164
+
1165
+ **Type:** const string
1166
+
1167
+ Table position is used in table.new, table.cell functions.
1168
+
1169
+ ---
1170
+
1171
+ ## position.top_right
1172
+
1173
+ **Type:** const string
1174
+
1175
+ Table position is used in table.new, table.cell functions.
1176
+
1177
+ ---
1178
+
1179
+ ## scale.left
1180
+
1181
+ **Type:** const scale_type
1182
+
1183
+ Scale value for indicator function. Indicator is added to the left price scale.
1184
+
1185
+ ---
1186
+
1187
+ ## scale.none
1188
+
1189
+ **Type:** const scale_type
1190
+
1191
+ Scale value for indicator function. Indicator is added in 'No Scale' mode. Can be used only with 'overlay=true'.
1192
+
1193
+ ---
1194
+
1195
+ ## scale.right
1196
+
1197
+ **Type:** const scale_type
1198
+
1199
+ Scale value for indicator function. Indicator is added to the right price scale.
1200
+
1201
+ ---
1202
+
1203
+ ## session.extended
1204
+
1205
+ **Type:** const string
1206
+
1207
+ Constant for extended session type (with extended hours data).
1208
+
1209
+ ---
1210
+
1211
+ ## session.regular
1212
+
1213
+ **Type:** const string
1214
+
1215
+ Constant for regular session type (no extended hours data).
1216
+
1217
+ ---
1218
+
1219
+ ## settlement_as_close.inherit
1220
+
1221
+ **Type:** const settlement
1222
+
1223
+ A constant to specify the value of the settlement_as_close parameter in ticker.new and ticker.modify functions.
1224
+
1225
+ ---
1226
+
1227
+ ## settlement_as_close.off
1228
+
1229
+ **Type:** const settlement
1230
+
1231
+ A constant to specify the value of the settlement_as_close parameter in ticker.new and ticker.modify functions.
1232
+
1233
+ ---
1234
+
1235
+ ## settlement_as_close.on
1236
+
1237
+ **Type:** const settlement
1238
+
1239
+ A constant to specify the value of the settlement_as_close parameter in ticker.new and ticker.modify functions.
1240
+
1241
+ ---
1242
+
1243
+ ## shape.arrowdown
1244
+
1245
+ **Type:** const string
1246
+
1247
+ Shape style for plotshape function.
1248
+
1249
+ ---
1250
+
1251
+ ## shape.arrowup
1252
+
1253
+ **Type:** const string
1254
+
1255
+ Shape style for plotshape function.
1256
+
1257
+ ---
1258
+
1259
+ ## shape.circle
1260
+
1261
+ **Type:** const string
1262
+
1263
+ Shape style for plotshape function.
1264
+
1265
+ ---
1266
+
1267
+ ## shape.cross
1268
+
1269
+ **Type:** const string
1270
+
1271
+ Shape style for plotshape function.
1272
+
1273
+ ---
1274
+
1275
+ ## shape.diamond
1276
+
1277
+ **Type:** const string
1278
+
1279
+ Shape style for plotshape function.
1280
+
1281
+ ---
1282
+
1283
+ ## shape.flag
1284
+
1285
+ **Type:** const string
1286
+
1287
+ Shape style for plotshape function.
1288
+
1289
+ ---
1290
+
1291
+ ## shape.labeldown
1292
+
1293
+ **Type:** const string
1294
+
1295
+ Shape style for plotshape function.
1296
+
1297
+ ---
1298
+
1299
+ ## shape.labelup
1300
+
1301
+ **Type:** const string
1302
+
1303
+ Shape style for plotshape function.
1304
+
1305
+ ---
1306
+
1307
+ ## shape.square
1308
+
1309
+ **Type:** const string
1310
+
1311
+ Shape style for plotshape function.
1312
+
1313
+ ---
1314
+
1315
+ ## shape.triangledown
1316
+
1317
+ **Type:** const string
1318
+
1319
+ Shape style for plotshape function.
1320
+
1321
+ ---
1322
+
1323
+ ## shape.triangleup
1324
+
1325
+ **Type:** const string
1326
+
1327
+ Shape style for plotshape function.
1328
+
1329
+ ---
1330
+
1331
+ ## shape.xcross
1332
+
1333
+ **Type:** const string
1334
+
1335
+ Shape style for plotshape function.
1336
+
1337
+ ---
1338
+
1339
+ ## size.auto
1340
+
1341
+ **Type:** const string
1342
+
1343
+ Size value for plotshape, plotchar functions. The size of the shape automatically adapts to the size of the bars.
1344
+
1345
+ ---
1346
+
1347
+ ## size.huge
1348
+
1349
+ **Type:** const string
1350
+
1351
+ Size value for plotshape, plotchar functions. The size of the shape constantly huge.
1352
+
1353
+ ---
1354
+
1355
+ ## size.large
1356
+
1357
+ **Type:** const string
1358
+
1359
+ Size value for plotshape, plotchar functions. The size of the shape constantly large.
1360
+
1361
+ ---
1362
+
1363
+ ## size.normal
1364
+
1365
+ **Type:** const string
1366
+
1367
+ Size value for plotshape, plotchar functions. The size of the shape constantly normal.
1368
+
1369
+ ---
1370
+
1371
+ ## size.small
1372
+
1373
+ **Type:** const string
1374
+
1375
+ Size value for plotshape, plotchar functions. The size of the shape constantly small.
1376
+
1377
+ ---
1378
+
1379
+ ## size.tiny
1380
+
1381
+ **Type:** const string
1382
+
1383
+ Size value for plotshape, plotchar functions. The size of the shape constantly tiny.
1384
+
1385
+ ---
1386
+
1387
+ ## splits.denominator
1388
+
1389
+ **Type:** const string
1390
+
1391
+ A named constant for the request.splits function. Is used to request the denominator (the number below the line in a fraction) of a splits.
1392
+
1393
+ ---
1394
+
1395
+ ## splits.numerator
1396
+
1397
+ **Type:** const string
1398
+
1399
+ A named constant for the request.splits function. Is used to request the numerator (the number above the line in a fraction) of a splits.
1400
+
1401
+ ---
1402
+
1403
+ ## strategy.cash
1404
+
1405
+ **Type:** const string
1406
+
1407
+ This is one of the arguments that can be supplied to the default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the ‘qty’ parameter in strategy.entry or strategy.order function calls. It specifies that an amount of cash in the strategy.account_currency will be used to enter trades.
1408
+
1409
+ ### Code Example
1410
+ ```pine
1411
+ //@version=6
1412
+ strategy("strategy.cash", overlay = true, default_qty_value = 50, default_qty_type = strategy.cash, initial_capital = 1000000)
1413
+
1414
+ if bar_index == 0
1415
+ // As ‘qty’ is not defined, the previously defined values for the `default_qty_type` and `default_qty_value` parameters are used to enter trades, namely 50 units of cash in the currency of `strategy.account_currency`.
1416
+ // `qty` is calculated as (default_qty_value)/(close price). If current price is $5, then qty = 50/5 = 10.
1417
+ strategy.entry("EN", strategy.long)
1418
+ if bar_index == 2
1419
+ strategy.close("EN")
1420
+ ```
1421
+
1422
+ ---
1423
+
1424
+ ## strategy.commission.cash_per_contract
1425
+
1426
+ **Type:** const string
1427
+
1428
+ Commission type for an order. Money displayed in the account currency per contract.
1429
+
1430
+ ---
1431
+
1432
+ ## strategy.commission.cash_per_order
1433
+
1434
+ **Type:** const string
1435
+
1436
+ Commission type for an order. Money displayed in the account currency per order.
1437
+
1438
+ ---
1439
+
1440
+ ## strategy.commission.percent
1441
+
1442
+ **Type:** const string
1443
+
1444
+ Commission type for an order. A percentage of the cash volume of order.
1445
+
1446
+ ---
1447
+
1448
+ ## strategy.direction.all
1449
+
1450
+ **Type:** const string
1451
+
1452
+ It allows strategy to open both long and short positions.
1453
+
1454
+ ---
1455
+
1456
+ ## strategy.direction.long
1457
+
1458
+ **Type:** const string
1459
+
1460
+ It allows strategy to open only long positions.
1461
+
1462
+ ---
1463
+
1464
+ ## strategy.direction.short
1465
+
1466
+ **Type:** const string
1467
+
1468
+ It allows strategy to open only short positions.
1469
+
1470
+ ---
1471
+
1472
+ ## strategy.fixed
1473
+
1474
+ **Type:** const string
1475
+
1476
+ This is one of the arguments that can be supplied to the default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the ‘qty’ parameter in strategy.entry or strategy.order function calls. It specifies that a number of contracts/shares/lots will be used to enter trades.
1477
+
1478
+ ### Code Example
1479
+ ```pine
1480
+ //@version=6
1481
+ strategy("strategy.fixed", overlay = true, default_qty_value = 50, default_qty_type = strategy.fixed, initial_capital = 1000000)
1482
+
1483
+ if bar_index == 0
1484
+ // As ‘qty’ is not defined, the previously defined values for the `default_qty_type` and `default_qty_value` parameters are used to enter trades, namely 50 contracts.
1485
+ // qty = 50
1486
+ strategy.entry("EN", strategy.long)
1487
+ if bar_index == 2
1488
+ strategy.close("EN")
1489
+ ```
1490
+
1491
+ ---
1492
+
1493
+ ## strategy.long
1494
+
1495
+ **Type:** const strategy_direction
1496
+
1497
+ A named constant for use with the direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a buy order.
1498
+
1499
+ ---
1500
+
1501
+ ## strategy.oca.cancel
1502
+
1503
+ **Type:** const string
1504
+
1505
+ A named constant for use with the oca_type parameter of the strategy.entry and strategy.order commands. It specifies that the strategy cancels the unfilled order when another order with the same oca_name and oca_type executes.
1506
+
1507
+ ### Remarks
1508
+ Strategies cannot cancel or reduce pending orders from an OCA group if they execute on the same tick. For example, if the market price triggers two stop orders from strategy.order calls with the same oca_* arguments, the strategy cannot fully or partially cancel either one.
1509
+
1510
+ ---
1511
+
1512
+ ## strategy.oca.none
1513
+
1514
+ **Type:** const string
1515
+
1516
+ A named constant for use with the oca_type parameter of the strategy.entry and strategy.order commands. It specifies that the order executes independently of all other orders, including those with the same oca_name.
1517
+
1518
+ ---
1519
+
1520
+ ## strategy.oca.reduce
1521
+
1522
+ **Type:** const string
1523
+
1524
+ A named constant for use with the oca_type parameter of the strategy.entry and strategy.order commands. It specifies that when another order with the same oca_name and oca_type executes, the strategy reduces the unfilled order by that order's size. If the unfilled order's size reaches 0 after reduction, it is the same as canceling the order entirely.
1525
+
1526
+ ### Remarks
1527
+ Strategies cannot cancel or reduce pending orders from an OCA group if they execute on the same tick. For example, if the market price triggers two stop orders from strategy.order calls with the same oca_* arguments, the strategy cannot fully or partially cancel either one. Orders from strategy.exit automatically use this OCA type, and they belong to the same OCA group by default.
1528
+
1529
+ ---
1530
+
1531
+ ## strategy.percent_of_equity
1532
+
1533
+ **Type:** const string
1534
+
1535
+ This is one of the arguments that can be supplied to the default_qty_type parameter in the strategy declaration statement. It is only relevant when no value is used for the ‘qty’ parameter in strategy.entry or strategy.order function calls. It specifies that a percentage (0-100) of equity will be used to enter trades.
1536
+
1537
+ ### Code Example
1538
+ ```pine
1539
+ //@version=6
1540
+ strategy("strategy.percent_of_equity", overlay = false, default_qty_value = 100, default_qty_type = strategy.percent_of_equity, initial_capital = 1000000)
1541
+
1542
+ // As ‘qty’ is not defined, the previously defined values for the `default_qty_type` and `default_qty_value` parameters are used to enter trades, namely 100% of available equity.
1543
+ if bar_index == 0
1544
+ strategy.entry("EN", strategy.long)
1545
+ if bar_index == 2
1546
+ strategy.close("EN")
1547
+ plot(strategy.equity)
1548
+
1549
+ // The ‘qty’ parameter is set to 10. Entering position with fixed size of 10 contracts and entry market price = (10 * close).
1550
+ if bar_index == 4
1551
+ strategy.entry("EN", strategy.long, qty = 10)
1552
+ if bar_index == 6
1553
+ strategy.close("EN")
1554
+ ```
1555
+
1556
+ ---
1557
+
1558
+ ## strategy.short
1559
+
1560
+ **Type:** const strategy_direction
1561
+
1562
+ A named constant for use with the direction parameter of the strategy.entry and strategy.order commands. It specifies that the command creates a sell order.
1563
+
1564
+ ---
1565
+
1566
+ ## text.align_bottom
1567
+
1568
+ **Type:** const string
1569
+
1570
+ Vertical text alignment for box.new, box.set_text_valign, table.cell and table.cell_set_text_valign functions.
1571
+
1572
+ ---
1573
+
1574
+ ## text.align_center
1575
+
1576
+ **Type:** const string
1577
+
1578
+ Text alignment for box.new, box.set_text_halign, box.set_text_valign, label.new and label.set_textalign functions.
1579
+
1580
+ ---
1581
+
1582
+ ## text.align_left
1583
+
1584
+ **Type:** const string
1585
+
1586
+ Horizontal text alignment for box.new, box.set_text_halign, label.new and label.set_textalign functions.
1587
+
1588
+ ---
1589
+
1590
+ ## text.align_right
1591
+
1592
+ **Type:** const string
1593
+
1594
+ Horizontal text alignment for box.new, box.set_text_halign, label.new and label.set_textalign functions.
1595
+
1596
+ ---
1597
+
1598
+ ## text.align_top
1599
+
1600
+ **Type:** const string
1601
+
1602
+ Vertical text alignment for box.new, box.set_text_valign, table.cell and table.cell_set_text_valign functions.
1603
+
1604
+ ---
1605
+
1606
+ ## text.format_bold
1607
+
1608
+ **Type:** const text_format
1609
+
1610
+ A named constant for use with the text_formatting parameter of the label.new(), box.new(), table.cell(), and *set_text_formatting() functions. Makes the text bold.
1611
+
1612
+ ---
1613
+
1614
+ ## text.format_italic
1615
+
1616
+ **Type:** const text_format
1617
+
1618
+ A named constant for use with the text_formatting parameter of the label.new(), box.new(), table.cell(), and *set_text_formatting() functions. Italicizes the text.
1619
+
1620
+ ---
1621
+
1622
+ ## text.format_none
1623
+
1624
+ **Type:** const text_format
1625
+
1626
+ A named constant for use with the text_formatting parameter of the label.new(), box.new(), table.cell(), and *set_text_formatting() functions. Signifies no special text formatting.
1627
+
1628
+ ---
1629
+
1630
+ ## text.wrap_auto
1631
+
1632
+ **Type:** const string
1633
+
1634
+ Automatic wrapping mode for box.new and box.set_text_wrap functions.
1635
+
1636
+ ---
1637
+
1638
+ ## text.wrap_none
1639
+
1640
+ **Type:** const string
1641
+
1642
+ Disabled wrapping mode for box.new and box.set_text_wrap functions.
1643
+
1644
+ ---
1645
+
1646
+ ## true
1647
+
1648
+ Literal representing one of the values a bool variable can hold, or an expression can evaluate to when it uses comparison or logical operators.
1649
+
1650
+ ### Remarks
1651
+ See the User Manual for comparison operators and logical operators.
1652
+
1653
+ ---
1654
+
1655
+ ## xloc.bar_index
1656
+
1657
+ **Type:** const string
1658
+
1659
+ A constant that specifies how functions that create and modify Pine drawings interpret x-coordinates. If xloc = xloc.bar_index, the drawing object treats each x-coordinate as a bar_index value.
1660
+
1661
+ ---
1662
+
1663
+ ## xloc.bar_time
1664
+
1665
+ **Type:** const string
1666
+
1667
+ A constant that specifies how functions that create and modify Pine drawings interpret x-coordinates. If xloc = xloc.bar_time, the drawing object treats each x-coordinate as a UNIX timestamp, expressed in milliseconds.
1668
+
1669
+ ---
1670
+
1671
+ ## yloc.abovebar
1672
+
1673
+ **Type:** const string
1674
+
1675
+ A named constant that specifies the algorithm of interpretation of y-value in function label.new.
1676
+
1677
+ ---
1678
+
1679
+ ## yloc.belowbar
1680
+
1681
+ **Type:** const string
1682
+
1683
+ A named constant that specifies the algorithm of interpretation of y-value in function label.new.
1684
+
1685
+ ---
1686
+
1687
+ ## yloc.price
1688
+
1689
+ **Type:** const string
1690
+
1691
+ A named constant that specifies the algorithm of interpretation of y-value in function label.new.
1692
+
1693
+ ---
1694
+