NexusFi: Find Your Edge


Home Menu

 





Can someone help to translate Pine Code to Easy Language ?


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Kolnidrei with 1 posts (0 thanks)
    2. looks_two Shaban with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 ernestho with 1 posts (0 thanks)
    1. trending_up 2,742 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Can someone help to translate Pine Code to Easy Language ?

  #1 (permalink)
ernestho
Kowloon, Hong Kong
 
Posts: 1 since Mar 2019
Thanks Given: 0
Thanks Received: 0

I found one script from tradingview. It looks interesting. Can someone help to convert Pine Code to EasyLanguage ?


 
Code
 
//@version=2 
//created by StevenH and SeaSide420

study("TC True Strength Indicator", shorttitle="TSI")
long = input(title="Long Length", type=integer, defval=35)
short = input(title="Short Length", type=integer, defval=35)
signal = input(title="Signal Length", type=integer, defval=13)
linebuy = input(title="Upper Line", type=integer, defval=4)
linesell = input(title="Lower Line", type=integer, defval=-4)
price = close
double_smooth(src, long, short) =>
    fist_smooth = ema(src, long)
    ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)
keh = tsi_value>linesell?lime:orange
teh = ema(tsi_value, signal)>linebuy?orange:red
meh = ema(tsi_value, signal)>tsi_value?red:lime
plot(tsi_value, color=keh, linewidth=2)
plot(ema(tsi_value, signal), color=teh, linewidth=2)
plot(linebuy,color=green),plot(linesell,color=red)
plot(cross(tsi_value, ema(tsi_value, signal)) ? tsi_value : na, style = circles, color=meh, linewidth = 3)
hline(0, title="Zero")

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
55 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
29 thanks

  #3 (permalink)
Kolnidrei
Lyon/France
 
Posts: 23 since Aug 2012
Thanks Given: 1
Thanks Received: 14


Hi, sometimes one needs some patience to get answers...

 
Code
Inputs:
price(close),
long(35),
shortt(35),
signal(13),
linebuy(4),
linesell(-4),
Width(10);
Vars:
pc(0),first_smooth_pc(0),double_smoothed_pc(0),first_smooth_abs_pc(0),x(0),
double_smoothed_abs_pc(0),tsi_value(0),keh(white),teh(white),meh(white);

pc = price - price[1];
first_smooth_pc = XAverage(pc, long);
double_smoothed_pc = XAverage(first_smooth_pc, shortt);
first_smooth_abs_pc = XAverage(abs(pc), long);
double_smoothed_abs_pc = XAverage(first_smooth_abs_pc, shortt);
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc);
x = XAverage(tsi_value,signal);
keh = iff(tsi_value>linesell,colorlime,
iff(tsi_value<linesell,colororange,keh[1]));
teh = iff(x>linebuy,colororange,
iff(x<signal,red,teh[1]));
meh = iff(x>tsi_value,red,
iff(x<tsi_value,colorlime,meh[1]));
Drawline(tsi_value,"tsi",stylesolid,2,keh);
Drawline(x,"ema_tsi",stylesolid,2,teh);
Drawline(linebuy,"buy",styledash,1,green);
Drawline(linesell,"sell",styledash,1,red);
Drawline(0,"zero",styledash,1,yellow);
if tsi_value crosses x or x crosses tsi_value then
DrawSymbol(tsi_value,"cross",SymbolCircle,Width,meh,meh);

Reply With Quote
  #4 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129

In my archive I have found this formula in easylanguage of True Strength Indicator:

{True Strength Indicator}

Input:
length1(34),
length2(8),
length3(5);

If(absvalue(c-c[1])<>0) then begin;
Plot1(100*(xaverage(xaverage(c-c[1],length1),length2)/
(xaverage(xaverage(absvalue(c-c[1]),length1),length2))),"Plot1");

Plot2(xaverage(100*(xaverage(xaverage(c-c[1],length1),length2)/
(xaverage(xaverage(absvalue(c-c[1]),length1),length2))),length3),"Plot2");

Plot3((0),"Plot3");
end;



[img]https://i.postimg.cc/GhXYd3Sp/True-Strength-Indicator.jpg[/img]

Reply With Quote





Last Updated on June 17, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts