Ptt
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.
PTT | Big picture | Symmetrical Triangle TFWPrice Action & Chart Pattern Trading
I don't know why I kept this stock for a few years and didn't take profit. This symmetrical triangle has been going on for 2 years++ and coming to a considerably narrow down for breaking point. Hopefully, it will make some sense at the end.
Trade with affordable risk ratio
Always respect your stop
PTT (SET) - Be Carefull for bearish temporaryHumbled, we would like to thanks for your support who has already liked, commented and followed us. Your support, strengthens us, to help in analyzing the market.
If you have any questions, do not be hesitant to send us message (inbox). Again, We have also provide signal recommendation with detail instruction
PTT (SET) - Be Carefull for bearish temporary
PTT, One of my best trade this month so far.The price opened near the floor, at 26.75. I waited for the trend reversal signal. Bought at 28.00 and sold it all around 30.5. Very good profit due to the big position. If you are also at the screen this morning, you would also see that this is the very easy-to-spot big mover. The volume is just so good that almost everyone can make some profit there, I think. *I personally think that the stock open at such a low price is not only just because the panic, but also because of those Forced-Sell positions. I really feel bad for them. Sometime the market is very unpredictable.
PTT (SET Index Thailand) Using the basically technical analysis (Support and Resistance) and fundamental. I expected the price of PTT will go up in the short term depend on the oil price. Based on the oil price, now the price of it also touched the resistance at 42.20 US per Barrel in D time frame then the price go up to approximately 48.20 because of OPEC. Now we should looking closely at the price of WTI on Monday morning to support the technical analysis. If the price continue go up, it will the good opportunity to long position (Don't forget your money management because there is no one know exactly about price in Stock market). Happy trading everyone.
20181228 Study of the recent rise of SET:PTT.
3.bp.blogspot.com
In this educational idea, stock graphs of SET:PTT the largest oil company in Thailand are studied in comparison between daily (left) and weekly (right) time frames. With a few tools chosen from the Graph Reader Pro 4.0 for TradingView such as SMA3 (green), SMA13 (aqua), SMA50(yellow/magenta), SMA200 (blue) and CC59 counting with CC59 Resistance (horizontal orange), CC59 Support (horizontal aqua), RSI(14) and MACD(12,26,9).
The Price rally of PTT began in July 2017 and ended in May 2018. The gain was about 50% in 10 months. In July 2017, the daily RSI was at 30% and the weekly RSI was about 50%. The price then climbed up quickly until the weekly CC59 counted up to "+9" and the RSI in both time frames reached 70%. This was the first rise that followed by correction/accumulation for about 2 months. The second rise was then started with CC59 count +1 up to +9. Then a few weeks of correction/accumulation followed. The third rise shot up the initial peak very quickly within two weeks. Eight weeks later the second peak was created at the level slightly higher than the initial peak. Although the second peak was higher than the first one, its corresponding RSI was lower. This indicated a bearish divergence state that signaled the end of the uptrend. Investors with trained eyes had two weeks to spot this divergence and take profit before the long downtrend started. It can be seen that the weekly graph is cleaner and easier to read .