NexusFi: Find Your Edge


Home Menu

 





Import indicator from .txt


Discussion in MultiCharts

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




 
Search this Thread

Import indicator from .txt

  #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:

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
 
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

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 Twitter 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


© 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