TradingView
CryptoRox
14 ינו׳ 2020 21:56

Incremental Order size + 

Bitcoin / US Dollar IndexBitMEX

תיאור

This is an old and incomplete script that is being pulled up and dusted off as per request.

The sole purpose of this script was to provide code snippets allowing one to easily convert their own script/strategy to include incremental order sizes. More control over your pyramiding orders.

**It may repaint, and was not intended for trading but more as an attempt to provide examples for more control with pyramiding.

הערות שחרור

Updated to Pine version 4.
תגובות
TradeBattlefield
very nice,
is it may repaint?
coralgoal
.
aliasnoa
I'm trying to figure out how to basically buy using 5% of my funds, and if signa happens again, buy with another 5% and so on, but not buy if no funds available. I think I got it working with pyramiding = 20 but the takeprofit seems to be averaging all my trades then selling all at once. Is it possible for each trade to have it's own take profit (of the same amount, like 5% or whatever) but each one sells at 5% above it's own entry amount. Anyone know?
aliasnoa
@aliasnoa, I also want a signal to exit, so it closes 1 trade when it hits the signal, another trade when it hits the signal again, etc. or 1 trade when that specific trade hits its stoploss, and so on
aliasnoa
@aliasnoa, I think this script might do it, but the 500 lines of code is pretty crazy
kurtsmock
Sweet dude. Thanks
FLeite28
Thanks !!!! i was looking for how to solve my problem and after looking yyour code now its clear for me what i need to do. Thankss! You really helped me a lot
syrinxflunki
Adding to my reading list, thnx
CryptoRox
@syrinxflunki, I hope you enjoy it.

It may look like a lot to read, but once you get into it, you'll see that most of it is simply cutting and pasting while changing some numbers.
Samweis
Very nice,
i have a script with similar structure in parts of the code.
Sometimes I want to run the script in version v4, but unfortunately I can't.

I think this line of code is the problem:
It causes problems when compiling in V4

last_long = long ? time : nz(last_long[1])
last_short = short ? time : nz(last_short[1])

Do you know a way to write your code in v4?
Can you encode the same function in v4 and share it as well?
עוד