TradingView
Crypto-Oli
10 Ara 2019 08:13

BLANK Strategy + TSL + Backtestrange 

Bitcoin / US Dollar Perpetual Inverse Swap ContractBitMEX

Açıklama

- I often see ppl struggeling do the first own strategy
- this is an example, for a smooth start

- EDIT it to your needs ( DELET my EXAMPELS and add your INPUTS/CONDITIONS)

- i added also a Backtestrange, so you can test your Strategy in different marketphases
- also added a trailing-stop-loss
Yorumlar
BlockchainSpecialists
Hi, thanks for this! Do you know how to have variable long/short entry conditions? For example in this strategy, a true/false input for each ema cross, if true then included in long/short conditions, if false then not included? Thanks a lot.
Crypto-Oli
@BlockchainSpecialists,

Hello, if you need crosses use longCondition = cross(ema1,ema2)

this is only a Startpoint for your own strategy ... you can find Help here tradingview.com/pine-script-reference/v4/
BlockchainSpecialists
@Crypto-Oli, Thanks for your reply. I actually found a solution soon after posting. I opted for longcondition = iff(usevariable == true, variable, na) and iff( etc.... Allowed me to make my long condition change quite drastically without too much code.
Crypto-Oli
@BlockchainSpecialists,

nice =) ... one important point : the Trailing Stoploss is buggy ... TV only uses ohlc data , so you will most likly more often stoped out then the strategy implies , keep that in mind
Daha Fazla