TS easylanguage to lua script conversion

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

TS easylanguage to lua script conversion

Postby noyp22 » Thu Sep 15, 2022 7:44 am

Hello guys,
This is a TS indicator that creates and update ascii data file in real time as new data appears on the TS chart. Dynamic Trader then reads and charts these ascii file real time.

Code: Select all
{This file is source code for the Easy Language interface to DT. }

Vars: Directory("C:\DTTSDATA"),Interval(" "),FileName(""),x(0),wParm(0),ThisVolume(0),Count( 0),LastDate(0),LastTime(0),fname("");

definedllfunc:"C:\dttsdata\DTTS.DLL",int,"SendData ",float,lpstr,lpstr,lpstr,float,float,float,float, float,float,float,float;


ThisVolume = Ticks;

if barnumber = 1 then
begin

if DataCompression = 0 then Interval = NumToStr(Highest(upticks + downticks,5),0);
if DataCompression = 1 then Interval = NumToStr(BarInterval,0);
if DataCompression = 2 then Interval = "Daily";
if DataCompression = 3 then Interval = "Weekly";
if DataCompression = 4 then Interval = "Monthly";

fname = MidStr(getsymbolname,+0,3)+ MidStr(getsymbolname,+5,7) + "_"+Interval+"."; {name & extension only}

if DataCompression = 0 then fname = fname + "dtt";
if DataCompression = 1 then fname = fname + "dti";
if DataCompression = 2 then fname = fname + "dtd";
if DataCompression = 3 then fname = fname + "dtw";
if DataCompression = 4 then fname = fname + "dtm";

FileName = Directory + fname;

Input: cf(4);

FileDelete(FileName);
FileAppend(FileName,"cf= " + NumToStr(cf,0) + newline);
if DataCompression = 0 then FileAppend(FileName,"ticks= " + Interval + NewLine);
if DataCompression = 1 then FileAppend(FileName,"min= " + Interval + NewLine);
if DataCompression > 1 then FileAppend(FileName, LeftStr(Interval,1) + NewLine);
FileAppend(FileName,"DATE TIME OPEN HIGH LOW CLOSE VOLUME" + NEWLINE);

for x = MaxBarsBack downto 1
begin
ThisVolume = iff(DataCompression =0,Upticks[x] + DownTicks[x],Ticks[x]);
fileappend(FileName,numtostr(date[x],0) + " " + numtostr(time[x],0) + " " +
numtostr(open[x],4) + " " + numtostr(high[x],4) + " " + numtostr(low[x],4) + " " + numtostr(close[x],4) + " " +
numtostr(ThisVolume,0) + newline);
LastDate = Date; {Date & Time of last whole bar stored in file}
LastTime = Time;
end;
end;

wParm=BarStatus(1); {NOTE: Does not return 0 for opening tick as specified in docs!}

if wParm = 2 then
begin {Last Tick Of Bar, print new line}
fileappend(FileName,numtostr(date,0) + " " + numtostr(time,0) + " " +
numtostr(open,cf) + " " + numtostr(high,cf) + " " + numtostr(low,cf) + " " + numtostr(close,cf) + " " +
numtostr(ThisVolume,0) + newline);
end;

if LastBarOnChart then
begin
if (wParm<>2 or (date <> LastDate) or (time <> LastTime)) then {we're not duplicating last bar in file}
value1 = SendData(wParm,MidStr(getsymbolname,InStr(getsymbo lname,":")+1,20),Interval,fname,Date,Time,Open,Hig h,Low,Close,ThisVolume,OpenInt);
end;


Thanks,
Noyp22
Last edited by noyp22 on Mon Sep 19, 2022 4:43 am, edited 1 time in total.
noyp22
 
Posts: 10
Joined: Sun Aug 08, 2021 2:52 am

Re: TS easylanguage to lua script conversion

Postby Apprentice » Sun Sep 18, 2022 5:21 am

We have added your request to the development list.
Development reference 560.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: TS easylanguage to lua script conversion

Postby noyp22 » Sun Mar 19, 2023 10:55 pm

Hello Guys,

Any chance on this request ?

Thanks,
Noyp
noyp22
 
Posts: 10
Joined: Sun Aug 08, 2021 2:52 am


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot], captainjacksparrow and 19 guests