Skip to content

Commit 3f9079b

Browse files
committed
x
1 parent 3c1992f commit 3f9079b

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

examples/pine/README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,28 @@ To use it from python, you need to import module, which name is located in your
5252

5353
For examle:
5454

55+
`my_library.pine`
56+
57+
```pine
58+
export add(float x, float y) =>
59+
x + y
60+
```
61+
5562
`.qpace.json`
5663

5764
```json
5865
{
5966
"python": {
60-
"package": "python_pine_example"
67+
"package": "<PACKAGE_NAME>"
6168
}
6269
}
6370
```
6471

65-
`my_library.pine`
66-
67-
```pine
68-
export add(float x, float y) =>
69-
x + y
70-
```
72+
`main.py`
7173

7274
```python
73-
import python_pine_example as pine
75+
# Make sure you use correct name!
76+
import <PACKAGE_NAME> as pine
7477

7578
pine.my_library.add(5.0, 25.0)
7679
```

examples/pine/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ohlcv = ctx.ohlcv
88

99
rsi = qp.ta.rsi(ctx.fork(), ohlcv.close)
10-
ma = pine.library.ma(ctx.fork(), src=ohlcv.close, length=90)
10+
ma = pine.my_library.ma(ctx.fork(), src=ohlcv.close, length=90)
1111
fig, (ax1, ax2) = plt.subplots(2, 1)
1212
ax1.plot(ohlcv.open_time, ohlcv.close, label="Close", color="black")
1313
ax1.plot(ohlcv.open_time, ma, label="Pine MA", color="red")

0 commit comments

Comments
 (0)