TradingView
Gentleman-Goat
30 Okt 2021 pukul 23.11

MacD Short and/or Long with Bi-Directional TP and SL  

Bitcoin / U. S. DollarKraken

Huraian

This tool allows you to test any variable value for MacD and Signal for going Long or Short with each market direction having customizable values for stop loss and take profit.

For example, sometimes the MacD and Signal values are better with different lengths between Short and Long. You can use this tool to see them overlaid and determine the best settings for going one direction or the other.

This script was preset for use with XBTUSD on the 4 hour time frame. Another example with this in mind, is take profits and stop losses might not work in the Long market direction but going Short does! Without this tool that would be hard to see since typically stop loss and take profit is applied to both directions. I found with this tool that a 20% take profit seems to be a good sweet spot for going short with this strategy.

You can customize which MacD histogram you see by going to the style section and turning off the Short or Long parameters so you can see only 1 histogram at a time if you wish.

If you have any questions, please PM me.

Komen
wielkieef
hello, dont know how works this version=5, can u make a short allertcondition to automated this strategy?
Gentleman-Goat
@wielkieef, Thank you again for the 100 coins :)
UnknownUnicorn40403838
this is soo cool thank you
btc220058921
Thanx Sir❤️
kaisuke7
Does this repaint?
Gentleman-Goat
@kaisuke7, No. There is no repainting. Repaint occurs when you use information from future bars and in particular the “security” command in pinescript. One of first scripts I ever made on here as a test to see how well you would do if you knew the future of the MacD was this, you can find it under the list of scripts I did. It was a fun little script to help me look for patterns for other script ideas. This script is legitimate though, you can watch the video about it I made if you click on my profile link, and of course all the code is open source.
kaisuke7
@Gentleman-Goat, Thanks for responding, This might be a dumb question but what does it mean when the script doesn't close the trade with a TP or SL and instead opens a trade in the opposite direction?
Gentleman-Goat
@kaisuke7,assuming you are referring to closing a long trade (which is buying), opening in the opposite direction means you are going “short” which means you are hypothetically borrowing money from your broker by selling the asset with a promise you will pay it back, ideally at a better price. For example if you open a short position on bitcoin at say 40,000 you are saying that you are selling 40,000 worth of bitcoin (that you don’t have but the broker has from there supply of bitcoin for shorting purposes) and you are in a contract to owe them back the bitcoin you “sold”. Ideally if you buy back all the bitcoin you sold at a cheaper price, say the price goes down, then you make profit. However, If the price goes up then you are losing money and worse yet you have what is called a margin limit, if you get close to not having the money in your account to pay back the bitcoin you sold from the broker they can forcefully close your position to ensure they don’t lose money on the deal. For this reason if you are shorting it’s critical to have a stop loss! This way if some buyer comes out of nowhere you don’t get liquidated suddenly.
chronocr0ss
Ask for an indicator strategy that can enter both LONG and SHORT when it hits, closes, opens and follows the sequence at the same time. Is there a way for the time indicator strategy to be a bit different?

thank you
Gentleman-Goat
@chronocr0ss, can you explain in more detail what you mean with examples?
Lebih