PINE SCRIPT: 75% Win Rate on a Simple Pullback Strategy

PINE SCRIPT: 75% Win Rate on a Simple Pullback Strategy

The Art of Trading

2 года назад

216,157 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Okiem Taty
Okiem Taty - 11.10.2023 14:08

Hi I'm getting a Syntax error at input 'strategy' pointing to the line with the buyCondition conditional as below:

stopDistance = strategy.position_size > 0 ? ((buyPrice - close)/ close) : na
stopPrice = strategy.position_size > 0 ? buyPrice - (buyPrice * i_StopPercent) : na
stopCondition = strategy.position_size > 0 and stopDistance > i_StopPercent

// Enter positions
if buyCondition
strategy.entry(id="Long", direction=strategy.long)

Yes there is a tab in the block following if, not sure what it wants, any ideas?

Ответить
penator
penator - 30.09.2023 18:44

lol i made this test and my max drawdown is on 22.6% when i have a SL on 10% ^^ how come

Ответить
Basit
Basit - 08.09.2023 15:38

the source code can be used in jupyter notebook or google colab for parameter tuning ?

Ответить
Federico Solano
Federico Solano - 06.09.2023 05:28

Excellent Trading Video Professor

Ответить
JOHN BEVAN
JOHN BEVAN - 13.08.2023 11:49

ye tradingview looks so good but then the spread changes or doesnt account for bid and ask always seems to give mid price charts

Ответить
Zen Bull Trading
Zen Bull Trading - 13.08.2023 08:51

can we see a LTF strategy ? :))

Ответить
Robert Nowak
Robert Nowak - 01.08.2023 23:05

Excellent video, gives nice insight to pine.

Ответить
God official
God official - 21.07.2023 14:17

if you use this on ETHUSD on the 30min timeframe there are 80% anual returns

Ответить
Leonardo Savini
Leonardo Savini - 13.07.2023 11:24

This video helped me. It covers key Pine Script syntax quickly while explaining other trading concepts. It will not waste your time.

Ответить
Dr. Snow
Dr. Snow - 05.07.2023 21:15

One other factor to consider, when comparing this strategy vs. buy and hold, is taxes. Short term capital gains will likely seriously affect the final outcome.

Ответить
Bennis The Mennis
Bennis The Mennis - 02.07.2023 13:37

I slightly changed the strategy you used as an example and back tested on EURUSD (76 trades from 7/8/20 to 2/7/23) and USDJPY (73 trades over the same time frame) and the results were pretty good. USDJPY risking 1 percent per trade with a 1.1 RR yielded 30.52% profit with a 68.49% win rate. EURUSD yielded 24.14% profit with a 64.47% win rate. All I changed was I added an ATR (14 RMA) and did 1x the ATR value for my stop loss. So rules were:

For Long entry. Price must close below the 10 ema, enter on the open of the next candle. Use 1x the ATR for the stop loss and 1.1 RR for TP. Opposite for shorts

Now 70ish trades over 3 years might not seem like much but if you are trading both pairs thats around 150 trades, I also plan to back test on the other major currency pairs and if they yield the same results, you have yourself a completely mechanical strategy with a high win rate and regular set ups. Would take all of 10 minutes at the end of each daily candle to sit down and glance over your forex pairs and set up your positions and require zero thought. In case anyone was looking for a good strategy foundation, this is a good one

Ответить
Long Tu
Long Tu - 02.07.2023 08:21

This is really amazing. Thank you so much !!!

Ответить
Tani Emoni
Tani Emoni - 29.06.2023 15:25

very good excellent presentation

Ответить
KNIGHT NXK
KNIGHT NXK - 09.06.2023 19:04

on one minute time frame, as of right now, if you go with MA1 as 141 or 270 and MA2 as 20
without ticking the exit on lower close, you can get to around 80-81% profitability per trade, makes your net profit higher and if you keep it that way, it reduces the lag between realized profits if i can express myself so. you get around 190 trades and 8 candles per average which is great, because it will read the performance for less than a day, which is what you'd normally want.

and my net profit percentage is 2.48%
strangely enough here, if you play with different numbers for starting capital you will get different percentage gain which is weird, the lowest one that was similar to automatically set 50k was 4,333 everything else tends to lower the profit percentage number

Ответить
andoni arriazu
andoni arriazu - 09.06.2023 13:58

When I run the identical code I get error after error... buff

Ответить
HPloveCraftMacNcheese
HPloveCraftMacNcheese - 22.05.2023 05:25

Started doing my first pine coding today. It took me a while to get this to work, but I managed to get through it and see a result.

Ответить
Zak Lloyd
Zak Lloyd - 20.05.2023 09:12

Nice video.
What Im struggling to get my head round is if the win rate is 75% we make 0.44% 75 times in 100, but lose 10% 25 times in a hundred? OR am i misunderstanding in that the overall average including losses is 0.44%

Ответить
Look for the set up
Look for the set up - 19.05.2023 03:48

10% is a huge stop loss range. if the stock is trading at $335 then the stop loss won't hit until it drops $33.5 per share = $301.5

Ответить
howtolooseweight
howtolooseweight - 14.05.2023 06:15

As I am pretty new to this trading stuff, i find your videos usefull to learn about trading in general, learning the syntax of pine script and getting a taste of diffrent strategies.

I must admit I'm currently expanding on your code from this video and it left me with a few questions:
1. I want this script to be used by a bot, like from wickhunter. How do i tell my script it has to follow the 1 minute chart? I know you have an user input for resolution but is that enough?
2. I know you can see some data on a candle bar that hasnt been finalised yet, but can i access that specific data within my script? I think i will have the add "calc_on_every_tick=true" in strategy i suppose.

Any help would be greatly appriciated.

Regards,

E.

Ответить
Teddy Perera
Teddy Perera - 13.05.2023 10:02

Thank you so much. This is an amazing tutorial! Plesae do more Pine script strategy testing videos.

Ответить
Charis Constantinou
Charis Constantinou - 08.05.2023 15:55

I believe that the stopDistance formula is wrong. Isn't it more accurate if it was (buyPrice-close) / buyPrice ?

Ответить
Reynaldo Azpurua
Reynaldo Azpurua - 03.05.2023 22:57

Great video, thanks

Ответить
Future Spokesman
Future Spokesman - 01.05.2023 21:47

I'm getting a syntax error

Ответить
Alain Claveau
Alain Claveau - 15.04.2023 05:39

Perhaps i dont understand, but i have pasted the 75% win rate provided code and ran the strategy tester, and here is the result is -94.32%...

Ответить
GabrielsTears
GabrielsTears - 13.04.2023 22:02

Thank you. This looks great. I am going to convert this to ninjascript.

Ответить
Peedle Deedle
Peedle Deedle - 12.04.2023 23:12

I want you to know that I subscribed to this channel exclusively because of the way that you corrected the ABOVE audio cut.

Also good video

Ответить
Algo T
Algo T - 12.04.2023 03:26

Did anyone try running the code independently? What pairs/timeframes are you guys using?

Ответить
Peter Brunet
Peter Brunet - 09.04.2023 04:35

Thank you for the detailed walk-through. Do you haver a video or resource showing how to get this PineScript Code into Think or Swim?

Ответить
Anand Menezes
Anand Menezes - 07.04.2023 08:29

Hello Sir, can you provide me with a pinescript for Open Equals Low candlesticks
in an Hourly time frame or any time frame with a signal. It will be easier
to find OEL candles quickly.

Ответить
sqGHOST
sqGHOST - 06.04.2023 20:44

100% i was thinking about the simple pine for this exact topic

Ответить
FX Surgeon
FX Surgeon - 01.04.2023 10:46

Good strategy but not robust. It’s long-only and will not work when market conditions change.

Ответить
Krzysztof Kuczmanski
Krzysztof Kuczmanski - 29.03.2023 17:59

Really good video about teaching how pine script works but this strategy is garbage

Ответить
ai_ Love_E
ai_ Love_E - 27.03.2023 16:10

10% per year is ridiculously low though!

Ответить
JB
JB - 26.03.2023 07:26

As an adult who never learned coding when I should have, your videos have been a godsend. I just recently finished the free basics course and I will be signing up for the mastery course. I saw one video on your YT page involved Python. I've recently started a beginners Python course as well, and let me just say, I would also pay for a Python course from you, if you ever get to producing it.

Ответить
Robert Donovan
Robert Donovan - 17.03.2023 10:48

Interesting. One other thing I noticed was that many of the losing trades were taken when the slope of the two averages disagreed. I'm curios to see how taking only the trades when the slope of the two averages was up would do.

Ответить
rnl2004
rnl2004 - 17.03.2023 03:56

Sir this is awesome strategy video. Is it only applies to Daily timeframe or can be use any? Thanks... and more power!!!

Ответить
loot6
loot6 - 08.03.2023 17:00

Interesting that it does indeed get a 75% win rate but ONLY with S&P500, with anything else I tried, especially any forex pairs it loses every single trade.

Ответить
Nikos Bays
Nikos Bays - 21.02.2023 16:46

im now starting to learn pine script and investing, looks very interesting, but is it doing in real life? is it working as the strategy tester?do we have any real life results?

Ответить
ricochet
ricochet - 21.02.2023 13:45

What i don't get is how the strategy.entry and strategy.close calls know that the opening price of the next day should be used. Is that a default behaviour?
buyPrice and stopPrice are only used here to visualize the next day's entries. Are you sure that the entries are not performed using the close price of the day where buy and sell conditions return true?

Ответить
Excel Moves
Excel Moves - 02.02.2023 00:39

Can you design a stock strategy that gives no more than 7 trades a day with a high win % rate and high profit factor? .....or is that too dificult?

Ответить
Erudite lifts
Erudite lifts - 31.01.2023 23:20

I wonder what the results were if you included the short side, or a modified short condition to take profits earlier (given that SPY is overall bullish long-term).

Ответить
Indian Motivation X
Indian Motivation X - 31.01.2023 12:40

Code is not working please help . var float buyprice =0

Ответить
Matthew Alcala
Matthew Alcala - 25.01.2023 02:52

This lesson is amazing. Can't thank you enough for sharing your code. Thank you!

Ответить
Joost Meeuwissen2
Joost Meeuwissen2 - 25.01.2023 02:42

Nice video thanks! I think the script would benefit from a direction check of the moving average. If it trends up i would take a long and if it goes down take a short.

Ответить
Gold Mine Beats
Gold Mine Beats - 15.01.2023 08:06

I've tried recreating this script but it's full of errors. I can't add it to my chart.

Ответить
CIA
CIA - 12.01.2023 19:50

so inspirational

Ответить