HOW-TO: Build your strategy with Protervus Trading ToolkitHi Traders! This tutorial will show you how to build your own strategy and link it to Protervus Trading Toolking (PTT) .
First of all, let me remind everyone that this content should be considered educational material, and backtesting results are not a guarantee. My goal is not to provide ready-made strategies, signals, or infallible methods, but rather indicators and tools to help you focus on your own research and build a reliable trading plan based on discipline.
So, without further ado let's start building our first strategy!
For this tutorial we'll build a simple EMA Cross strategy and add the Chaining Snippet to link it to PTT.
The first step is to create a new indicator in Pine Editor and add the initial requirements:
//@version=5
indicator("EMA Cross (data chaining)", overlay = true)
Let's now create the inputs where we will be editing EMAs' length:
FastEmaLen = input.int(50, title = "Fast EMA Length")
SlowEmaLen = input.int(200, title = "Fast EMA Length")
At this point we can proceed by calculating the two EMAs:
FastEma = ta.ema(close, FastEmaLen)
SlowEma = ta.ema(close, SlowEmaLen)
We are now ready to script our Entry conditions:
BullishCross = ta.crossover(FastEma, SlowEma)
BearishCross = ta.crossunder(FastEma, SlowEma)
We also wish to see the two EMAs plotted on the chart, so we will add the following code:
plot(FastEma, color = color.new(color.green, 0))
plot(SlowEma, color = color.new(color.red, 0))
At this point, our code should look like this:
Great, we are now ready to add PTT Snippet by pasting all the code at the end of the one we just wrote.
Let's head to the CONDITIONS INPUTS section and replace the placeholder text for EntryCondition_1 , giving it a proper name:
EntryCondition_1 = input.bool(true, 'Ema Cross', group = 'Entry Conditions')
We can also add null to the unused inputs to clear the settings panel:
ADDING ENTRY CONDITIONS
We'll now be adding our Long and Short Entry conditions in the ENTRY \ FILTER CONDITIONS section.
In LongEntryCondition_1 we should replace null with BullishCross :
LongEntryCondition_1 = BullishCross
Same for ShortEntryCondition_1 down below:
ShortEntryCondition_1 = BearishCross
Guess what? We're done! We just added our Entry conditions:
We can now compile the script and add our indicator to the chart, along with PTT.
Let's open PTT and select "EMA Cross (data chaining): Chained Data" in the Source Selection drop-down menu - the data will now be forwarded to PTT and we can start tweaking the settings to experiment with our new strategy:
ADDING EXIT CONDITIONS
Let's say we now also want to add an Exit condition for when the price goes above (or below) the fast EMA, signaling a trend reversal: we can do that in no time!
Go back at the top of the code, and right after our EMA calculations, add:
PriceAboveFastEma = ta.crossover(close, FastEma)
PriceBelowFastEma = ta.crossunder(close, FastEma)
Of course, we also need to add the newly created conditions in the snippet code. Let's find the section EXIT CONDITIONS and, just like our Entry conditions, we can replace the null placeholder with our actual conditions:
LongExitCondition_1 = PriceBelowFastEma
...
ShortExitCondition_1 = PriceAboveFastEma
If we also want to use these conditions as Stops, we can add them to the STOP CONDITIONS section:
Note: Exit Conditions will close the trade in profit, while Stop Conditions will close the trade in loss. Still, you should not worry about scripting it yourself: PTT will take care of analyzing the trade and separate Exits from Stops when the signal to close the position is received.
ADDING FILTER CONDITIONS
Besides using our indicator to open and close trades, we can also use it to filter the signal from another, chained indicator.
To keep this tutorial simple, let's use the same EMA Cross script, so we can add it again to the chart and use the first one as Signal, and the second as Filter.
Let's add our Filter conditions in the script:
FastAboveSlow = FastEma > SlowEma
SlowAboveFast = FastEma < SlowEma
Just like we did in the previous steps, we should now add the option in the settings panel and the Filter conditions in the snippet code:
CHAINING INDICATORS
We currently have one EMA Cross indicator working as Signal in the chain, linked to PTT on the chart:
Let's copy-and-paste the EMA Cross indicator (or add it again) to have two of them.
The first one on the chain will act as Filter, so in the settings let's give the two EMAs a longer length (e.g. 250 and 300) in order to verify the trend and discard signals received when it's not favorable. Remember to set output mode as Filter, and tick the Filter box.
The second one will be our Signal: we can choose the length of the two EMAs we will use as Entry \ Exit when a cross happens (e.g. 100 and 200), enabling our Entry and Exit conditions by ticking the boxes. This time, we will tick the "Receive Data" box, and select the Chained source of the Filter:
If before linking the Filter you already had the Signal linked to PTT, you will notice it automatically recalculates the data - and if our Filter works as intended, the improvements will be visible ;)
EXTRAS
If your indicator doesn't plot anything on the chart, we must enable a "Dummy Plot" in order to prevent issues, since we are sending chained data as an invisible plot and it cannot be the only plot in the code.
Just un-comment the line plot(close < 0 ? close : na, title='Dummy Plot') to avoid this problem:
ADDING SIGNALS MARKERS
PTT will show all labels and markers for trades, but if you wish to have them on the indicator or just to debug your signals, you can enable and customize the last lines in the snippet:
CHAINING SCHEMA
|-- Filters (optional, any number of filters - linked one to another)
|---- Signal (mandatory, only one indicator must be set to Signal - in case of multiple Filters, Signal must be linked to the last Filter in the chain)
|------ Protervus Trading Toolkit (linked to Signal)
|-------- PTT Plugins (Strategy Wrapper, Trade Progression, etc - linked to PTT)
NOTES
- When you chain an indicator, its source remains "locked" even if you un-tick the Receive Data box. If you wish to use that source on another indicator you should un-link it first (just select "Close" as source to free the indicator's chain output).
- If you remove indicators in the chain, all other indicators linked AFTER it will be deleted - to prevent this, you should un-link chained indicators before removing them.
- Pine Script is limited to one source input per indicator, so you cannot chain indicators that let you choose another source to calculate data: for example, if you have an RSI indicator with a source selection ( input.source ) you must remove that input and only use the one for chaining. You can read more on PineScript Reference page.
Backtest
more practiceI was tasked with practicing how to set up back testing, so I created a video with all the steps over three charts. I selected a pair, then hovered my mouse pointer over the pair until the "eyeball" appeared and clicked that to make the chart "disappear". I then clicked the the replay button to enter the back test mode. the final step is to bring my chart back by repeating step 1 ( hover mouse pointer over the selected pair and then click the eyeball to unhide the chart).
Some mistakes that most traders makethat is import to know your mistake and then u have better winrate in your trades
this video is about trading on classic patterns on 1h timeframe or higher
and i will show u result of that (terrible result!)
but that will work on 1m or 5m or 15m if u trade like pro
NOTIC :the higher timeframes will work based of RTM or Static(not Dynamic) support and resistance
Education: Why your trading strategy win rate doesn't matter!What makes a profitable automated strategy?
Probably the biggest misconception for trading perpetuated in the mainstream is that you need to have a greater than 50% win rate to be profitable.
This is followed by a close second, of constantly assuming you need to have a risk-reward ratio of greater than 1:1 (e.g. 1:2, 1:3 etc). This one is perpetuated mostly by forex and stock market gurus.
By the end of this article, I hope to dispel these myths and aim to shed some truths on how to assess a profitable strategy.
Why your win rate doesn't matter:
Let's simplify this down using an example. Consider the following two strategies. Which one would you rather trade?
Strategy A: 50% win rate - When you win you make 2 dollars, but when you lose, you lose 1 dollar
Strategy B: 50% win rate - When you win you make 5 dollars, but when you lose, you lose 1 dollar
This one was a very obvious case of choosing Strategy B. In this case, both strategies have the same win rate, but Strategy B nets you 5 dollars per win, whereas Strategy A only makes you 2.
Let's take another example. A little less obvious this time. Which one would you rather trade here?
Strategy A: 90% win rate - When you win you make 1 dollar, but when you lose you lose 50 dollars
Strategy B: 10% win rate - When you win you make 200 dollars, but when you lose, you lose 1 dollar
Now the 90% win rate strategy may look attractive on the surface, but when you dig into it, you realise that you could get a massive 50 dollar loss in the 10% of times you do lose! For those of you who chose strategy B, this is the correct answer.
One way we can assess the above strategies is using Expectancy . The formula for Expectancy is as follows:
(Win % x Average Win Size) – (Loss % x Average Loss Size)
We can calculate the expectancies of the strategy below:
Strategy A:
(0.9 * 1) - (0.1 * 50) = -4.1
Meaning you are expected to lose an average of $4.10 per trade using strategy A. Not a good sign.
Strategy B:
(0.1 * 200) - (0.9*1) = 19.1
Meaning you are expected to win an average of $19.10 per trade using strategy B. This is a major winner here!
As you've probably realised. It is possible to have a profitable strategy using a low win rate. Many trend trading/breakout strategies tend to have lower win rates, but with larger rewards to risk, whilst mean-reversion strategies tend to have higher win rates with less frequent but larger drawdowns.
The backtest shown in this post shows an example of a low win rate, and high win amount strategy using the Smoothed Heikin Ashi Trend on Chart indicator which I have developed, with an overall positive expectancy, backtest (note, no strategy is perfect, should not just blindly trust backtest data).
Why you may still choose to define a risk/reward
Better consistency of your strategy
Psychological factor of knowing that you can be expected to lose only x amount (assuming no slippage etc)
As an aside, note that defining a fixed risk-reward may hurt your win rate (which could impact your expectancy) so it's important to backtest to see if you get better results with defined risk-reward parameters. This is beyond the scope of the current article, but an important consideration.
Why do traders gravitate toward a higher win rate?
The simple answer here is that everyone wants to be a winner! It's human nature to want to be right, whether this be about a market direction or when to open or close a trade. It's often easier to brag about how much you win whether that be on social media or just feeling good about yourself.
For algorithmic traders, having a higher win rate may also provide psychological benefits, as losing 20 times in a row can sometimes be very daunting for traders and can throw doubt into the efficacy of your system.
I hope that through this article, I have managed to convey that it may be prudent consider strategies with low win rates also, as these can be very profitable in their own right.
Digging further:
This article is only just scratching the surface of how to create and validate if a strategy is something that you should consider trading. There are many aspects of backtesting including Monte Carlo simulation, understanding standard deviation of returns and risk, Sharpe ratio, Sortino ratio, walk-forward analysis, and out-of-sample analysis to name a few that you should conduct before you evaluate a strategy as suitable for live trading.
If you've made it this far, thanks for reading. If you like the content, feel free to like and share, as well as check out some of the free scripts, strategies and indicators that I have published under the scripts tab.
Thank you!
Disclaimer: Not to be taken as financial advice, anything published by me is purely for education and entertainment purposes
How To Backtest Further In The Past On Low TimeframesQuick video to show this little trick using the Replay mode that allows us to load more historical bars than real time, and thus get a better picture at how a strategy can perform over time.
The Strategy Tester re-calculate the results everytime we load new bars, as the indicator strategy is correctly applied to these new bars.
I got the confirmation from the awesome TradingView Support Team that the extra data that you get this way is real and relevant, and can be used to test your strategies.
That means we are no more limited to 15/30 days backtest data in the 5min timeframe for example.
Ace of Waters - 4hr 280% 1yr backtestI have no words for this back test on gold 4hr Oanda chart - Heikinashi candles. Over 280% profit in the previous year, within just over 240 trades. Only a max drawdown of 0.46%%??? My jaw is literally on the floor right now. It has always been my dream to find a reasonable solution to market volatility on GOLD .... The test includes the .005% fee Oanda charges PLUS the 15 tick average spread or 'slippage'. Honestly, I dont know what to do. Its been 4 years and 100's of hours trying to find something simple, sustainable and for gods sakes understandable. I think mitigation of such a huge profit potential with such a small draw down is THE holy grail I was looking for. IT IS NOT FOR SALE. DONT ASK. LOOK AT THE CHART, FIGURE IT OUT FOR YOUR SELF. PS. The settings and calculations derived are NOT arbitrary or discretionary. Its dynamic and relative. I dont claim to hold any superior math skills BUT ive done enough to know the dangers of second guessing. Ide be happy trading this algorithm on autopilot and dont profess any knowable future results BUT who cares, your going to likely win 3/4 trades and the trades you loose will likely only be 1/7th the trades you win. Be like water my friends.
Do You Have an Edge in The Market?Hello, traders!
Have you ever wondered why it feels so hard to be consistently profitable in trading?
If you have, It's okay. You're not the only one
In fact 90% of traders lose money consistently.
What have they done to deserve that?
This is what 90% of traders do:
- looking for holy grail strategy
- when it fails, they jump to other strategy
- they never verify the strategy by doing their own research (back testing, forward testing, live account demonstration)
- rinse and repeat
With this mentality, they've become jack of all trades and masters of none. They took every possible opportunity without knowing the probability of the outcome. With so much strategy in their mind, the trading outcome become random and haphazard. If you include the emotional damage factor, this approach in trading will bring negative equity expectancy in the long run.
Instead of jumping from one method to another, ask yourself this question:
1. What specific method do you use?
2. What timeframe?
3. What kind of market work with the method?
4. How many sample do you have in your back test?
5. How much is your average win rate, risk reward?
The clearer your answer, the better. It will give you more confidence in your strategy execution. You'll also be calmer when losing streak comes. Less emotional damage = better outcome and more consistent result. Here's an example from one of my backtest (not a recommendation to use my method, please do your homework):
1. What specific method do I use?
In this example, I use trend continuation chart pattern (mostly flag, rising/falling wedge, pennant, symmetrical triangle).
I use ema200 as filter. If the price is below ema200 I have sell bias. If the price is above ema200 I have buy bias. So if I see bullish chart pattern while the price is far below ema200, I won't take the trade
I add MACD as momentum indicator. If the setup accompanied with MACD crossover, it shows momentum shift and good potential entry point.
2. What timeframe?
I use m30 timeframe in this back test
3. What kind of market work with the method?
I tested with best results in JPY forex pairs (especially AUDJPY, GBPJPY, CADJPY) and AUDUSD
4. How many sample do you have in your back test?
in GBPJPY I have collected 110 trade sample with the same method from January 2021 to December 2021. (I recorded the screenshot of the back test too)
5. How much is your average win rate, risk reward?
In those 110 sample, I got 72 wins and 38 losses with 1:1.5 risk to reward ratio. This means I have about 65.45% win rate. So this system gives me positive return expectancy based on the back test.
After you've answered these 5 questions, you can do forward testing with a small account (if you want to use demo account first, It's okay. But take into account you won't experience the emotional factor). Record your trading result until you've gathered enough data and you feel comfortable with the result.
Congratulation, you've got yourself a proven strategy that you're comfortable to trade with. After that, all you need to do is be so good with that system until it becomes very intuitive to you.
Stick to one method and become the master of that method.
Just as Bruce Lee said:
"I fear not the man who practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times"
Don't be lazy and do your homework dear traders!
This Is Why You Must Perform In Depth Market Analysis!It's not so simple doing market analysis some times.
What time frame should you use? What indicators should you have on your chart? What drawings should you make?
Every forex "mentor" pushes their 'unique' strategy to profitably trade forex markets, however can you be sure that their strategy is truly profitable?
Before you start trading a strategy live you should KNOW for certain that a strategy is possible. There is only one way to be certain that a strategy is profitable - back testing.
Any trading strategy should be thoroughly back tested on the symbol you want to trade prior to trading a live account. Otherwise how can you be sure you'll make money? Answer - you can't.
In going live with a trading strategy you should have expectations about the number of trades you will win / lose / scratch at. You should also know the profit margins to expect.
Without data on a trading strategy you are gambling and hoping.
Many traders automate trading strategies to automatically back test their trading system. This is something that makes back testing a lot easier and more fun.
If you want to start trading the first place you should start is on a spread sheet!
Now just remember, if you want to trade like a winner you have to put in the work like a winner.
Winner winner, chicken dinner.
So - BACK TEST YOUR TRADING SYSTEM
Also, many traders preach fixed risk management ideas such as "only ever risk 1-3% a trade".
THIS ADVICE IS BOGUS!
Once you have backtested your trading system you will know what the ideal risk exposure for your trading system will be. Some systems only have profitable returns when risking a fixed dollar amount, some will return greater with a fixed % amount.
Some trading strategies with high strike rates will allow traders to risk up to 5-10% a trade, whereas other systems may only risk 0.3-0.5% a trade.
There is so much mis-information in the trading industry, and the reality is you do not need to buy a trading system or a mentor.
You only need to do the necessary work to backtest strategies until you come up with a profitable one, and then model the risk exposure to find what returns the most!
RANT OVER.
Nasdaq - an Index of Bigtime Back-Test for Big-Tech: in 3DOftentimes I note in these posts that I am "scouting a back-test" of a certain level. Nasdaq's All Time High run provide a great example of what this looks like in practice. The first pattern to note is the failed H&S, price did not return to the pattern neckline failing to trigger and entry. Then a perfect test of the rising wedge lower bound before consecutive moves to the upside. I use the back-test level to increase the probability and boost the risk to reward ratios.
Small Backtest And a Few Price Development Scenarios FLOKI/USDTFloki to me is a combination of speculation and project on a fundamental basis. I've owned Floki for a long time. If you have to believe Social Media, every Memecoin is worth gold. Never buy any coin without analysis. A YouTuber promoting a coin is not an analysis. Now that Floki is finally showing some data on Tradingview, it's time for an analysis
Fundamental and general analysis
After last month's rally, Floki is consolidating. This is a good sign for me to generate a zone of liquidity for the future.
I focus more on a rising price over the longer term, because:
-Crypto, in general, shows a rising price (bullish)
-The team behind Floki is working on a mega marketing campaign around the world. In December it's America's turn
-Big names (Tyson Fury) promote FLOKI
I also think it's important to also look at the critical side:
- Manipulation is common with relatively low market cap coins. (currently around 2-3Billion)
- The project is largely based on a meme which also increases the volatility.
- If cryptos like Bitcoin and Ethereum fall in price, it often correlates to other currencies. The project can have so much potential but still drops in price (temporarily).
Technical analysis
- Currently, Floki is consolidating between 0.00022 - 0.00029. Wait for an outbreak and more confirmations (retest, fib levels, price action) before going long or short.
- If the price breaks through resistance from support it's probably manipulation. keep an eye on the larger timeframes (preferably the daily). 0.00032-0.00036 is an area where you can expect resistance. (.61-.81 Fibonacci level)
- Conversely, panic can be caused by the price breaking through the support. I'm keeping an eye on 0.000125 - 0.000160 to buy at a potential discountarea. Again, other confirmations are important here
- In the most positive scenario, I have 0.0005 - 0.0006 zone in mind as the next price target to take partial profits (50% increase since last high.)
Important
- So at the moment I am neutral on price expectations and waiting for new data to go long or short
- Always do your own analysis and don't risk more than you can lose. My opinion of Floki is not financial advice
5 Key Advices To Share With Trader Who Is Struggling In TradingHello everyone:
Lately many of you have messaged me about getting FOMO and entering trades without confirmations.
In addition you can't seem to “not” enter trades when the market hasn't shaped up to your strategy and entry criteria.
I am hoping in today’s educational video it can help some of you guys to get back on track.
I want to share 5 main pieces of advice that can help out traders who are currently struggling.
These are experiences and lessons that I accumulate throughout the 8 years of trading and in hope to help some of you who are struggling in your current journey of trading.
1. Do “NOT” think about get rich quick in trading
-Trading is a marathon, not a sprint
-90-95% traders fail due to a combination of: Greed, FOMO, mindset/emotion, risk management, trading psychology.
-Trading is not a get rich quick scheme, but it can produce consistent, sustainable passive income if you can put in the time and effort
-Most try to jump to the result right away, without going through the journey, that is not how life works.
2. No trading strategies, style, method can give you 100% strike rate
-Trading is probability, not right or wrong.
-Understand you can have the best strategy in the world, and still not be profitable.
- Technical, Fundamental, Algo, EA...etc can all not work. This is why risk management is important to not over risk, over trade, over leverage your trading account
3. Backtest and journal
-Backtest your strategy so your brain acknowledges and recognizes it over and over again.
-Slowly build up confidence in your strategy and method. IT will come to you like second nature
-Journal all your wins and losses so you can review them. Work on them, accept your mistakes to grow and improve.
4. Control your EGO
-Human beings have ego to prove others are wrong and they are right
-We refuse to admit we made the error/mistakes, and blame others/external as the cause.
-Acknowledge that in trading, stop blaming the market, the broker, the mentor, the strategy...etc.
-Don't take things personally and be offended by it.
5. Never Give Up
-I blew several accounts in the beginning of trading career, gave up and quit trading multiple times
-I always ended up coming back to trading. After taking time off. Whether that is weeks or months in the beginning journey.
-No one is born into a trader, just like no one is born into a doctor, lawyer.
-If trading was that easy, then everyone would be rich.
-Success is measure by how many times you get back up when you failed
I hope these pointers can help you guys to get more focus and get back on track in trading.
Any questions, comments or feedback welcome to let me know, thank you
Jojo
Below I will share others educational videos that have direct relations to the topics above:
Trading Psychology: How to deal & manage losses/consecutive losses in trading ?
Trading Psychology: Revenge Trading
Trading Psychology: Fear Of Missing Out
Trading Psychology: Over Leveraged Trading
Trading Psychology: Is there Stop Loss Hunting in Trading ? How to deal with it ?
Prevent Blowing an account by backtesting:
Risk Management 101
Backtesting Bitcoin: From bullish to bearishHi there,
Personally, I think it's important to backtest prices. In this way, you better understand why a price reacts to events.
Today I backtested bitcoin. I was especially curious about how to recognize the switch from bullish to bearish. I use the daily chart for this because I invest in the long term.
Are you a day trader? Then you can also backtest on lower timeframes. Keep in mind that the uncertainty factor is a lot bigger.
The backtest
Before a bullish period turns into a bearish period, you need several confirmations.
1. We saw the trendline break. This is not yet a reason to become bearish because you can determine a trend in several ways
2. The support zone is broken. Combine this with the broken trend line and the higher low that is no longer valid.
3. Reason enough for me to make a Fibonacci from the highest point to the lower point. On the chart, you can see that I go from spike to spike. The price is looking for a retest before the big drop starts. This to me is the .649, .71 or .81 zone.
4. the price breaks the support zone, retests, and finally drops to the next larger support zone. At that moment a new accumulation starts and it is again waiting for new confirmations.