NexusFi: Find Your Edge


Home Menu

 





Import indicator from .txt


Discussion in MultiCharts

Updated
    1. trending_up 2,409 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
wtrader
Turin Italy
 
Posts: 6 since Dec 2011
Thanks Given: 1
Thanks Received: 1

Hi all, i need to import one indicator from external txt, someone know is should be possible?

to test it i have created one export that can be applied to any chart to export a simple ATR indicator:
 
Code
inputs:
	ATRLength( 14 ),
	AlertLength( 14 ) ;

variables:
	var0( 0 ) ;

var0 = AvgTrueRange( ATRLength ) ;

Plot1( var0, "ATR" ) ; 

                  
condition1 = HighestBar( var0, AlertLength ) = 0 ;
if condition1 then
	Alert( "Indicator at high" ) 
else 
begin 
condition1 = LowestBar( var0, AlertLength ) = 0 ;
if condition1 then
	Alert( "Indicator at low" ) ;
end;
Print (File("C:\Temp\mytextfile.txt"),Numtostr( var0 , 4));


after that i create one import code, to test if the results was the same:



 
Code
var: MyATR (0),listid(0);

listid=Listn.New;


 value1 = Listn.Readfile(listid,"C:\Temp\mytextfile.txt");     
   
   
  Value2 = Listn.Get(Listid,barnumber);
  
 Print("ATR = ", Listn.Get(ListID, barnumber), " ", barnumber);

//Plot1(Lists.Get(ListID, barnumber), "ATR",Blue);
(plot is with comment to test print before)

i got no error from that code, but MC print just half of line correctly and after stop and put the indicator off.

someone should know why?

thank you so much.
walter


Reply With Quote
Thanked by:

 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
16 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

walter,

did you use the same chart for your export and import? You also need to make sure that the "Max number of bars study will reference" is exactly the same. Otherwise your barnumber variable will have different values on the same bar.

Regards,
ABCTG


Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
wtrader
Turin Italy
 
Posts: 6 since Dec 2011
Thanks Given: 1
Thanks Received: 1


Thanks ABCTG for your kind reply.

yes of course i did the test with the same export/import chart.

i will check also the "Max number of bars study will reference", but i'm not shure have influence..

thank you


Reply With Quote




Last Updated on November 14, 2013


© 2026 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 - Downloads - Top
no new posts