DashTrader

Real Turtle

There are a few different attempts at the turtle strategy on here, but none that I have seen thus far correctly follow the strategy as I know it. This version uses a stop order to trail out of the position by moving the stop order to match the exit channel or stoploss as the N*2( ema of True Range * 2). This version of turtle strategy also uses stop orders for entry on either side in order to enter at optimal time. The ability to specify a backtest period was borrowed from another script, I grabbed it so long ago I no longer remember from whom i borrowed it, if it was yours I will credit you if you PM me.

This version unlike others also allows you to specify a risk % so you only risk that percentage of your equity in a trade, as calculated from your stoploss.

Disclaimer: I have published several scripts in the past when i was first learning pinescript and they are all horrible please ignore those. I would delete them, but TV doesn't allow you to delete.
Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích

Bình luận

I'm getting an error saying that "Pine cannot determine the referencing length of a series" and that max_bars_back should be used in the strategy function. I changed the script in a copy that I've made and added the max_bars_back parameter with the value of 1000 and now it works again. Of course this was a hack as I'm not familiar with Pine, so I'm sure you have a better solution :).
+2 Phản hồi
Thank you sir, does this re-paint?
+1 Phản hồi
DashTrader montyjus
@montyjus, no repaint. You'd only see repaint if for instance security was used. The only other qwerk i have seen with TV api as far as strategy backtest goes is if your trail stop is really tight it will produce unbelievable results.
Phản hồi
DTCash DashTrader
@DashTrader, thanks for the work mate! I'm keen to give it a test later on. With regards to the stop loss bug you mentioned on TV, is there anywhere to get more info on this? I'm trying to get realistic strategy testing results and it seems I'm missing something, I've got the slippage, commission etc setup but my results still seem a bit off and my SL is tight, so think this may be a cause
Phản hồi
@DTCash, I assume you are referring to a strategy you made and not this strategy. can google it, but basically the way TV does trail stops is it is NOT using a lower timeframe only the current timeframe to determine the trailstop. Because of this is has to guess what the trailstop did so it assumes on every candle that the candle moved with your trail stop first. Thus if your trail stop is really tight you'll have unrealistic results because every tiny move is a win for you even when in reality it wasn't.
Phản hồi
There's error, how to fix it?
Phản hồi
300 trades and <20% drawdown is nice. Upvoted for your modest disclaimer.
Phản hồi
How to make viable for crypto charts? Always error.
Phản hồi
Thank you this was helpful since you have duplicated the original Turtle Strategy. Helpful in learning this core strategy since so many make variances. Again thank you.
Phản hồi
Much appreciated.
Phản hồi
Trang chủ Bộ lọc cổ phiếu Bộ lọc Forex Bộ lọc Tiền điện tử Lịch kinh tế Cách thức hoạt động Tính năng Biểu đồ Trả phí Giới thiệu bạn Quy tắc Áp dụng Trung tâm Trợ giúp Giải pháp cho Website & Nhà môi giới Widget Giải pháp biểu đồ Thư viện Biểu đồ Lightweight Blog & Tin tức Twitter
Hồ sơ Tùy chỉnh Hồ sơ Tài khoản và Thanh toán Giới thiệu bạn Xu Ticket Hỗ trợ của tôi Trung tâm Trợ giúp Các ý tưởng đã đăng Người theo dõi Đang theo dõi Tin nhắn riêng Trò chuyện Đăng xuất