Bitcoin Forecast

Pine Script Newsletter 2

Editor’s Note:

Whats up everybody, I’m currently in Virginia getting ready to head down to Florida soon. If your on the way, shoot me a message and maybe we can meet up!

I’m not really excited about writing this newsletter or writing in general, it’s something I hate to do, so I have been putting off this edition for a while.
But today is the day I have to publish, because I want to share some Black Friday deals you don’t want to miss!

Featured Indicator/Strategy:

Fundamentals Graphing – By Trendoscope
This script allows you to compare almost any fundamental metric across 40 assets, highlighting some really cool ways of graphing with Pine Script!

Pine Script Tips and Tricks:

Tip 1: Using the data window.
In Pine V5 we can now set a display argument to choose where to plot our outputs.
In the image below I am plotting my outputs only to the data window. This way I can observe these values and don’t have to worry about them drawing funny lines to my chart.

display = display.data_window

Tip 2: Checking a condition over a length of time.

I see this come up a lot where someone has two or more indicators they want to combine, but the signals of each indicator are slightly out of phase. Resulting in multiple corresponding signals that trigger on different bars, but more or less around the same time.

Example 1: What is expected.

Typically we combine both indicators using and so that both need to be true signals in order to trigger a “Master” signal.

masterBuy = indicator1Buy and indicator2Buy

In this case, both signals need to line up on the same bar in order for us to get our “Master Signal”, but this rarely occurs in most cases.

Example 2: What actually happens.

In most cases, the indicators we are trying to combine spit out signals that are leading or lagging, and fall on different bars. I call this “out of phase” (A concept in wave analysis used in electrical, audio and signal processing. Not to be confused with Elliot “Waves”.) So even though our assumptions about combining indicators for better confluence are true, we never get to capitalize on that because the signals fall on different bars.

Example 3: Using a loop to syncronize the out of phase signals.

In order to combine these signals there are a couple techniques we can use.
In this example, I will show you a function that you can use that will lookback over a period of bars and look for other signals. We can then use this to create our master signal.

lookback = input(15, 'Lookback')
// Checks if the condition is true at least once in the lookback period
f_any(condition, lookback) =>
    _result = false
    for i=0 to lookback
        if condition[i]
            _result := true

masterBuy = false
if indicator2Buy or indicator1Buy
    _indicator1Buy = f_any(indicator1Buy, lookback)
    _indicator2Buy = f_any(indicator2Buy, lookback)
    masterBuy     := _indicator1Buy and _indicator2Buy

plotchar(masterBuy, 'Any')

In the code above we run the function when either indicator triggers a signal. Then we run the function on each signal to lookback a period of bars and check if each condition was true at any point in time.
If both conditions are true then we get our master signal.

Pine Script Strategy Multiple Conditions Tradingview

TradingView Platform Updates:

Highlight the latest features, improvements, or changes related to TradingView

  • You can now request data directly from a github repository using request.seed() function in pinescript.
  • Logging is finally in Pine Script!!
    • Now you can finally see what your variables and data looks like deep inside your arrays, loops and anywhere in your code! You can see how your script is working at any point in time. This is a game changer!
    • Learn more here
  • You can now download the Pine Script Manual for offline use here
    • Funny enough, I just enabled this highly requested feature on my website about a month ago, but now TV has it!
  • You can now draw complex shapes using Polylines objects
  • You can now create data structures called Maps. These are similar to an excel sheet, where you have rows and columns. They are helpful for quickly storing and getting data to make tables.
  • Black Friday Sale is here!
    • If you ever wanted to upgrade to TV Premium now is the time. TV can get quite expensive, and while I try to teach all kinds of tips and tricks to get around purchasing a paid subscription, sometimes it’s necessary. For example, in order for me to grant access to PSStrategyX I need a Premium account so you can bet your butt I will be upgrading on this deal.

PineScriptStrategy Updates:

  • We removed the ChatGPT AI Tool for logged in users. I don’t think anyone was using it and it slowed down the website.
  • We Released a free tool that helps aggregate many popular indicators together to test in a strategy. You can check it out here and if you have any recommendations we can add more indicators to it.
  • Psychology is the most overlooked and most important concept in trading. We added Trader Profiles to the website. Sign in take the tests and see where you stand!
  • Get 75% off anything on for the next week (Expires November 29) by using code BLACKFRIDAY2023 (honestly, this is a ridiculous discount, but I don’t care, we’re all going to get rich in this next bull run. And since I probably won’t write another newsletter for a while I want these babies to be worth everyones time)

Community Showcase:

All of these indicators were made by people in the Pine Script Strategy Community.

Volume Profile Movable Range – By Cryptonema
This script allows you to see the volume profiles on your chart. It’s a lot like the built in volume profile, but since its an indicator it appears on every asset as you scroll through your watchlist, I find this very helpful for quickly identifying key levels during high volatility sessions when quick decisions need to be made.
Give a shoutout to EDU.C in the Discord for this one!

Flag Finder – By Amphibiantrading
(Yes, this was featured last edition, but I wanted to share it in the community showcase this time around as I found out that the Author is part of the Pine Script Strategy Community and I thought that was really cool! )
This indicator is a well-documented open-source tool designed to identify bull and bear flag patterns.  It’s pretty cool if you are into pattern trading. Especially when it comes to looking for flags, which for me are a powerful indicator of price movement. This indicator contains clear alertconditions that are ready to be converted into signals to be used for backtesting.

Technical Analysis Insights:

Ok so we are now 152 days until next having and things are starting to get really exciting in Crypto!
In the last edition I said to get in around 26k if you could and it turned out to be a perfect entry as price move up around 50% since then.

I am looking at the charts now, and things are not so clear.
But I have an idea of what might go down. We are sitting at around 36-38k range for a while now. I am anticipating a short move up to around $42k area, followed by a sell off down to the $30k region before we really take off for the moon. I am already in and riding this wave up for the long term, but have some short term positions riding as well that I will take off if we hit the $42k and I see price slow down.
For my psychology I find that’s the best strategy, as I never truly “miss a move” and I can have fun trading the market at the same time.

Resources and References:

Pine Script Documentation
Pine Coders
Free Pine Script Facebook Group
Awesome Pine Script Repo
Pine Script Blog

Stay tuned for more Pine Script insights in our next edition. Happy coding!

Best regards,
Paul D. Mendes
Pine Script Pulse Newsletter

Ps. If you like these, let me know. Writing is a pain for me, so if my pain brings you pleasure I want to know! 🥴
PPs. I know some of you don’t trade Crypto, you should, but you should also just go with what you know. Anyways, if you do trade crypto, you should have a hardware wallet and hold your own keys. Trezor is having a black friday sale too, so grab one of their hardware wallets and protect your investment and gain control of your finances. Here’s a link to their deals Here make sure to take my free course on self custody too! The code to make it free is BITCOINFREEDOM
PPPS. This is not financial advice, I am not a financial advisor, I am not responsible for losses or gains,.

Leave a Reply