NexusFi: Find Your Edge


Home Menu

 





True Strength Indicator/Easy Language programming problem


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one eseeker with 7 posts (1 thanks)
    2. looks_two Big Mike with 3 posts (0 thanks)
    3. looks_3 kzaorski with 2 posts (3 thanks)
    4. looks_4 jguellbo with 2 posts (0 thanks)
      Best Posters
    1. looks_one kzaorski with 1.5 thanks per post
    2. looks_two pbeguin with 1 thanks per post
    3. looks_3 RM99 with 1 thanks per post
    4. looks_4 eseeker with 0.1 thanks per post
    1. trending_up 11,122 views
    2. thumb_up 6 thanks given
    3. group 4 followers
    1. forum 18 posts
    2. attach_file 1 attachments




 
Search this Thread

True Strength Indicator/Easy Language programming problem

(login for full post details)
  #11 (permalink)
 kzaorski 
Warsaw, Poland
 
Experience: Beginner
Platform: MultiCharts
Broker: IB, IQFeed
Trading: TF
Posts: 5 since Aug 2011
Thanks Given: 13
Thanks Received: 6

Try this:


eseeker View Post
First: Create the Function TSI:

 
Code

 // Function: TSI
  [LegacyColorValue = true];
  inputs:  	Price(NumericSeries),  	Raw(NumericSimple),  	Smooth(NumericSimple), 	U(NumericSimple);
  vars:  	NetChg(0);  	NetChg = Price - Price[1];
  Value1 = 100 * XAverage(XAverage(XAverage(NetChg,Raw),Smooth),U);
  Value2 = XAverage(XAverage(XAverage(AbsValue(NetChg),Raw),Smooth),U);
  if Value2 <> 0 then 	TSI = Value1 / Value2 else 	TSI = 0;
 

-> Save as: TSI
--> Compile Function


eseeker View Post
Then create the TSI indicator.
 
Code

 // Indicator: TSI
  [LegacyColorValue = true];
  [SameTickOpt = True];
  inputs:  	Price(Close),  	Raw(26),  	Smoothed(12), 	Signal(5), 	OB(20), 	OS(-20);
  Plot1(TSI(Price, Raw, Smoothed,1), "TSI");
  Plot2(XAverage(Plot1,signal),"XAvg ");
  Plot3(OB,"Overbought");
  Plot4(OS,"Oversold"); 

--> Compile Indicator

Reply With Quote
The following 2 users say Thank You to kzaorski for this post:

Can you help answer these questions
from other members on NexusFi?
Trader Dale [email protected] or Scammer Dale
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tao te Trade: way of the WLD
30 thanks
GFIs1 1 DAX trade per day journal
27 thanks
Supertradersams Thread Journal on NQ/MNQ
26 thanks
Deaddogs Stock Trading
23 thanks
Daytrading ES & NQ
12 thanks

(login for full post details)
  #12 (permalink)
eseeker
Vero Beach Florida
 
Posts: 8 since Dec 2011
Thanks Given: 1
Thanks Received: 1

I copied that exact 2 programs as mentioned above,and this is what I got:
The formula posted like this:
1#indicator "True Strength Indes", "Samples", "TSISample"
2
3// Function: TSI
4
5
6inputs:
7 Price(NumericSeries),
8 Raw(NumericSimple),
9 Smooth(NumericSimple),
10 U(NumericSimple);
11
12vars:
13 NetChg(0);
14
15 NetChg = Price - Price[1];
16
17Value1 = 100 * XAverage(XAverage(XAverage(NetChg,Raw),Smooth),U);
18Value2 = XAverage(XAverage(XAverage(AbsValue(NetChg),Raw),Smooth),U);
19
20if Value2 <> 0 then
21 TSI = Value1 / Value2
22else
23 TSI = 0;
24
25
26// Indicator: TSI
27
28
29{[SameTickOpt = True];}
30
31inputs:
32 Price(Close),
33 Raw(26),
34 Smoothed(12),
35 Signal(5),
36 OB(20),
37 OS(-20);
38
39Plot1(TSI(Price, Raw, Smoothed,1), "TSI");
40Plot2(XAverage(Plot1,signal),"XAvg ");
41Plot3(OB,"Overbought");
42Plot4(OS,"Oversold");

Compile Errors were:
21 Unknown symbol: TSI
21 Wrong sybmbol on left side: TSI
23 Unknown symbol: TSI
23 Wrong sybmbol on left side: TSI
32 Variable 'Price" is already defined
33 Variable 'Raw" is already defined
39 Unknown symbol: TSI
22 Cannot compile: True Strength Ind

I deleted the references to color.

Reply With Quote
(login for full post details)
  #13 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,234 since Jun 2009
Thanks Given: 33,106
Thanks Received: 101,351


No.

Do the function first. Stop. Save. Compile.

Then new indicator. Stop. Save. Compile.

You've put them all together, they are separate.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #14 (permalink)
eseeker
Vero Beach Florida
 
Posts: 8 since Dec 2011
Thanks Given: 1
Thanks Received: 1

I thank you both for your advice.
I followed your directions.

The first portion compiled fine and was saved as TSI.el

The second portion gave me eleven errors on the compile.

17 #function [SameTickOpt
18 // Indicator: TSI
19 [LegacyColorValue = true];
20 [SameTickOpt = True];
21 inputs: Price(Close), Raw(26), Smoothed(12), Signal(5), OB(20), OS(-20);
22 Plot1(TSI(Price, Raw, Smoothed,1), "TSI");
23 Plot2(XAverage(Plot1,signal),"XAvg ");
24 Plot3(OB,"Overbought");
25 Plot4(OS,"Oversold");

Errors
19 Syntax erro. "=" expected
17 Misused attribute unknown
19 Unsupported attribute
20(2) Unk attrib.; misused attri.
22-25 Plotting functions are not allowed.
18 Can't compile: TSI

Any ideas?
Thanks again.

Reply With Quote
(login for full post details)
  #15 (permalink)
 pbeguin 
West Hills, CA
 
Experience: Beginner
Platform: OEC Trader, MC/DT
Broker: OEC
Trading: TF
Posts: 12 since Oct 2009
Thanks Given: 7
Thanks Received: 22

Use this format to make this indicator work on the OEC platform. The function needs to be included in the actual indicator file.

 
Code
#indicator "True Strength Indes", "Samples", "TSISample"

// Indicator: TSI


{[SameTickOpt = True];}

inputs: 
 Price(Close), 
 Raw(26), 
 Smoothed(12),
 Signal(5),
 OB(20),
 OS(-20);

Plot1(TSI(Price, Raw, Smoothed,1), "TSI");
Plot2(XAverage(Plot1,signal),"XAvg ");
Plot3(OB,"Overbought");
Plot4(OS,"Oversold");

// Function: TSI

#function TSI
inputs: 
 Price(NumericSeries), 
 Raw(NumericSimple), 
 Smooth(NumericSimple),
 U(NumericSimple);
 
vars: 
 NetChg(0);

 NetChg = Price - Price[1];

Value1 = 100 * XAverage(XAverage(XAverage(NetChg,Raw),Smooth),U);
Value2 = XAverage(XAverage(XAverage(AbsValue(NetChg),Raw),Smooth),U);

if Value2 <> 0 then
 TSI = Value1 / Value2
else
 TSI = 0;

Reply With Quote
The following user says Thank You to pbeguin for this post:
(login for full post details)
  #16 (permalink)
eseeker
Vero Beach Florida
 
Posts: 8 since Dec 2011
Thanks Given: 1
Thanks Received: 1

HOORAH

I think the last one may be working.\
Many thanks,

I'll let you know what happens.
Dick

Reply With Quote
(login for full post details)
  #17 (permalink)
jguellbo
Palamós / Spain
 
Posts: 4 since Dec 2011
Thanks Given: 0
Thanks Received: 0

I'm a newbie in tradestation and I don't know how to compile a function. Can you explain me?

Thanks

Reply With Quote
(login for full post details)
  #18 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


jguellbo View Post
I'm a newbie in tradestation and I don't know how to compile a function. Can you explain me?

Thanks

When you compile a function, you're simply creating a file with a series of calculations that is named as the function word/name. That way, you can simply reference that group/function in other files such as indicators and strategies, without having to include all the language.

Once you copy/paste the language into a new function you opened, you simply click on the green check icon. If it's error free, it will turn neutral color and save it and give you no errors or warnings at the bottom of the EL program.

Only then can other indicators and strategies that are written with this function in them know what you're trying to refer to in the language.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
The following user says Thank You to RM99 for this post:
(login for full post details)
  #19 (permalink)
jguellbo
Palamós / Spain
 
Posts: 4 since Dec 2011
Thanks Given: 0
Thanks Received: 0

Thank you RM99, that's very kind of you.

Reply With Quote





Last Updated on August 2, 2012


© 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