GP - Long Short Scanner For ThinkOrSwim

@samer800 i am here to bother you again,Im sorry, i just saw this new indicator on trading view, look very good for day trading, i hope you can help me like alwyas, thank you in advance.
check the below
CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © gokhanpirnal
#indicator("GP - Long Short Scanner",shorttitle = 'GP - Long Short Scanner',
# Converted by Sam4Cok@Samer800 - 09 / 2023
input srcOpen = open;
input srcHigh = high;
input srcLow = low;
input srcClose = close;
input tsiLongLength = 1;
input tsiShortLength = 1;
input tsiSignalLength = 2;
input rsiLength = 2;

def na = Double.NaN;


#double_smoothopen(srcopen, long, short) =>
script double_smooth {
    input srcopen = open;
    input long = 1;
    input short = 1;
    def fist_smoothopen = ExpAverage(srcopen, long);
    def sec_smoothopen = ExpAverage(fist_smoothopen, short);
    plot out = sec_smoothopen;
}
def priceopen = open;
def pcopen = (priceopen - priceopen[1]);
def double_smoothed_pcopen = double_smooth(pcopen, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pcopen = double_smooth(AbsValue(pcopen), tsiLongLength, tsiShortLength);
def tsi_valueopen = 100 * (double_smoothed_pcopen / double_smoothed_abs_pcopen);
def rsiopen = RSI(Price = srcopen, Length = rsiLength);
def topen = tsi_valueopen + ExpAverage(tsi_valueopen, tsiSignalLength) + rsiopen;
def totalopen = topen;

def pricehigh = high;
def pchigh = (pricehigh - pricehigh[1]);
def double_smoothed_pchigh = double_smooth(pchigh, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pchigh = double_smooth(AbsValue(pchigh), tsiLongLength, tsiShortLength);
def tsi_valuehigh = 100 * (double_smoothed_pchigh / double_smoothed_abs_pchigh);
def rsihigh = RSI(Price = srchigh, Length = rsiLength);
def thigh = tsi_valuehigh + ExpAverage(tsi_valuehigh, tsiSignalLength) + rsihigh;
def totalhigh = thigh;

def pricelow = low;
def pclow = (pricelow - pricelow[1]);
def double_smoothed_pclow = double_smooth(pclow, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pclow = double_smooth(AbsValue(pclow), tsiLongLength, tsiShortLength);
def tsi_valuelow = 100 * (double_smoothed_pclow / double_smoothed_abs_pclow);
def rsilow = RSI(Price = srclow, Length = rsiLength);
def tlow = tsi_valuelow + ExpAverage(tsi_valuelow, tsiSignalLength) + rsilow;
def totallow = tlow;

def priceclose = close;
def pcclose = (priceclose - priceclose[1]);
def double_smoothed_pcclose = double_smooth(pcclose, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pcclose = double_smooth(AbsValue(pcclose), tsiLongLength, tsiShortLength);
def tsi_valueclose = 100 * (double_smoothed_pcclose / double_smoothed_abs_pcclose);
def rsiclose = RSI(Price = srcclose, Length = rsiLength);
def tclose = (tsi_valueclose + ExpAverage(tsi_valueclose, tsiSignalLength) + rsiclose);
def totalclose = tclose;

def minmin = Min(totalopen, Min(totalhigh, Min(totallow, totalclose)));
def min = if isNaN(min[1]) then 0 else
              Min(min[1], minmin);
def maxmax =  Max(totalopen, Max(totalhigh, Max(totallow, totalclose)));
def max = if isNaN(max[1]) then 0 else
               Max(max[1], maxmax);
def mindata = min;
def maxdata = max;

def totalmin=(mindata + totalclose);
def totalmaks=(maxdata + totalclose);

def longsart1=(if totalmin[1]<=(-390) then 1 else 0);
def longsart2=(if mindata[1]==totalclose[1] then 1 else 0);
def longsart3=(if mindata <totalclose then 1 else 0);

def shortsart1=(if totalmaks[1]>=587 then 1 else 0);
def shortsart2=(if maxdata[1]==totalclose[1] then 1 else 0);
def shortsart3=(if maxdata > totalclose then 1 else 0);

def minplot=(longsart1+longsart2+longsart3);
def maksplot=(shortsart1+shortsart2+shortsart3);

def EnterLong=(minplot[0]>2.9);
def EnterShort=(maksplot[0]>2.9);

AddChartBubble(EnterLong, low, "L", Color.GREEN, no);# title='Long Alarm'
AddChartBubble(EnterShort, high, "S", Color.RED);# title='Short Alarm'


# End of CODE
 
check the below
CSS:
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
#// © gokhanpirnal
#indicator("GP - Long Short Scanner",shorttitle = 'GP - Long Short Scanner',
# Converted by Sam4Cok@Samer800 - 09 / 2023
input srcOpen = open;
input srcHigh = high;
input srcLow = low;
input srcClose = close;
input tsiLongLength = 1;
input tsiShortLength = 1;
input tsiSignalLength = 2;
input rsiLength = 2;

def na = Double.NaN;


#double_smoothopen(srcopen, long, short) =>
script double_smooth {
    input srcopen = open;
    input long = 1;
    input short = 1;
    def fist_smoothopen = ExpAverage(srcopen, long);
    def sec_smoothopen = ExpAverage(fist_smoothopen, short);
    plot out = sec_smoothopen;
}
def priceopen = open;
def pcopen = (priceopen - priceopen[1]);
def double_smoothed_pcopen = double_smooth(pcopen, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pcopen = double_smooth(AbsValue(pcopen), tsiLongLength, tsiShortLength);
def tsi_valueopen = 100 * (double_smoothed_pcopen / double_smoothed_abs_pcopen);
def rsiopen = RSI(Price = srcopen, Length = rsiLength);
def topen = tsi_valueopen + ExpAverage(tsi_valueopen, tsiSignalLength) + rsiopen;
def totalopen = topen;

def pricehigh = high;
def pchigh = (pricehigh - pricehigh[1]);
def double_smoothed_pchigh = double_smooth(pchigh, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pchigh = double_smooth(AbsValue(pchigh), tsiLongLength, tsiShortLength);
def tsi_valuehigh = 100 * (double_smoothed_pchigh / double_smoothed_abs_pchigh);
def rsihigh = RSI(Price = srchigh, Length = rsiLength);
def thigh = tsi_valuehigh + ExpAverage(tsi_valuehigh, tsiSignalLength) + rsihigh;
def totalhigh = thigh;

def pricelow = low;
def pclow = (pricelow - pricelow[1]);
def double_smoothed_pclow = double_smooth(pclow, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pclow = double_smooth(AbsValue(pclow), tsiLongLength, tsiShortLength);
def tsi_valuelow = 100 * (double_smoothed_pclow / double_smoothed_abs_pclow);
def rsilow = RSI(Price = srclow, Length = rsiLength);
def tlow = tsi_valuelow + ExpAverage(tsi_valuelow, tsiSignalLength) + rsilow;
def totallow = tlow;

def priceclose = close;
def pcclose = (priceclose - priceclose[1]);
def double_smoothed_pcclose = double_smooth(pcclose, tsiLongLength, tsiShortLength);
def double_smoothed_abs_pcclose = double_smooth(AbsValue(pcclose), tsiLongLength, tsiShortLength);
def tsi_valueclose = 100 * (double_smoothed_pcclose / double_smoothed_abs_pcclose);
def rsiclose = RSI(Price = srcclose, Length = rsiLength);
def tclose = (tsi_valueclose + ExpAverage(tsi_valueclose, tsiSignalLength) + rsiclose);
def totalclose = tclose;

def minmin = Min(totalopen, Min(totalhigh, Min(totallow, totalclose)));
def min = if isNaN(min[1]) then 0 else
              Min(min[1], minmin);
def maxmax =  Max(totalopen, Max(totalhigh, Max(totallow, totalclose)));
def max = if isNaN(max[1]) then 0 else
               Max(max[1], maxmax);
def mindata = min;
def maxdata = max;

def totalmin=(mindata + totalclose);
def totalmaks=(maxdata + totalclose);

def longsart1=(if totalmin[1]<=(-390) then 1 else 0);
def longsart2=(if mindata[1]==totalclose[1] then 1 else 0);
def longsart3=(if mindata <totalclose then 1 else 0);

def shortsart1=(if totalmaks[1]>=587 then 1 else 0);
def shortsart2=(if maxdata[1]==totalclose[1] then 1 else 0);
def shortsart3=(if maxdata > totalclose then 1 else 0);

def minplot=(longsart1+longsart2+longsart3);
def maksplot=(shortsart1+shortsart2+shortsart3);

def EnterLong=(minplot[0]>2.9);
def EnterShort=(maksplot[0]>2.9);

AddChartBubble(EnterLong, low, "L", Color.GREEN, no);# title='Long Alarm'
AddChartBubble(EnterShort, high, "S", Color.RED);# title='Short Alarm'


# End of CODE
@samer800 thank you some much! really appreciate your time.
 
@samer800 thank you some much! really appreciate your time.
I dont see it much help with long short positions. see below. buying top and selling bottom

1694098164902.png
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
143 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top