[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Program to create hypo security with *Tomorrow's hypo Price*



PureBytes Links

Trading Reference Links


Friends,
 
Here is .JS code to create a dummy.csv file with tomorrows hypo price '1'.  The starting file is simply a file that contains all the dates (in 'MM/DD/YYYY) form seperated by a comma and hypo price of 1. Now this file is imported into AmiBroker (again via automation) which then creates a security with tomorrow's data with tomorrow's date ! (Since I don't take care of holidays in the creation of Dummy.CSV, I re-create it every day with valid dates based on one of the existing securities.)
 
//WScript.Echo( "starting");
var dateToday = new Date();var dateTomorrow = new Date();var s = "";var month = -1;var day = -1;var monthString = "";var dayString = "";var tomorrowMMDDYYYY = "";
dateTomorrow.setDate( dateTomorrow.getDate() + 1 );
month = dateTomorrow.getMonth() + 1;if ( month <= 9 ){    monthString = "0" + month;}else{    monthString = "" + month;}
day = dateTomorrow.getDate();if ( day <= 9 ){    dayString = "0" + day;}else{    dayString = "" + day;}
tomorrowMMDDYYYY = monthString + "/" + dayString + "/" + dateTomorrow.getYear();
//WScript.Echo( "Tomorrow: " + s );
fs = new ActiveXObject("Scripting.FileSystemObject");a = fs.OpenTextFile("c:\\ami\\amisystems\\dummy.csv", ForAppending, false);a.WriteLine(tomorrowMMDDYYYY + ",1");a.Close();
//WScript.Echo( "ending");
Regards,
- Salil V Gangal
Salil V Gangal <salil_gangal@xxxxxxxxx> wrote:
To: amibroker-dll@xxxxxxxxxxxxxxxFrom: Salil V Gangal Date: Sat, 16 Aug 2003 07:26:32 -0700 (PDT)Subject: Re: [amibroker-dll] Re: Program to create hypo security with Tomorrow's hypo Price
Hi Tomasz and Stephane,
 
Stephane -
 
Nice code.  But what happens is that the date is not tomorrows's date.  Just add "Title = Date() + " Close:" + WriteVal(myC,5.2);" to the code below and you'll see what I mean.  I'll give what I wanted and coded below.
 
Tomasz -
 
Thanks for the sample code. I was able to code *exactly* what I wanted using JScript.  The code I have simply appends tomorrows date and hypo price of 1 to a simple ASCII file.  Now this file is imported into AmiBroker (again via automation) which then created a security with tomorrow's data with tomorrow's date ! (Since I don't take care of holidays in the creation of Dummy.CSV, I re-create is every day with valid days based on one of the existing securities.  So the whole set-up works *exactly* I as need.)
 
//WScript.Echo( "starting");
var dateTomorrow = new Date();var s = "";var month = -1;var day = -1;var monthString = "";var dayString = "";var tomorrowMMDDYYYY = "";
dateTomorrow.setDate( dateTomorrow.getDate() + 1 );
month = dateTomorrow.getMonth() + 1;if ( month <= 9 ){    monthString = "0" + month;}else{    monthString = "" + month;}
day = dateTomorrow.getDate();if ( day <= 9 ){    dayString = "0" + day;}else{    dayString = "" + day;}
tomorrowMMDDYYYY = monthString + "/" + dayString + "/" + dateTomorrow.getYear();
//WScript.Echo( "Tomorrow: " + s );
fs = new ActiveXObject("Scripting.FileSystemObject");a = fs.OpenTextFile("c:\\ami\\amisystems\\dummy.csv", ForAppending, false);a.WriteLine(tomorrowMMDDYYYY + ",1");a.Close();
//WScript.Echo( "ending");
Regards,
- Salil V Gangal
 
 
Stephane Carrasset <s.carrasset@xxxxxxx> wrote:
Hi Salil,This AFL code works for the CAC ticker "999150", the last bar is customized...stephaneRefO=Ref(Foreign( "999150", "O"),1);RefH=Ref(Foreign( "999150", "H"),1);RefL=Ref(Foreign( "999150", "L"),1);RefC=Ref(Foreign( "999150", "C"),1);myO[0] = RefO[0];myH[0] = RefH[0];myL[0] = RefL[0];myC[0] = RefC[0];for( i = 1 ; i < BarCount-1; i++ )      {myO[i] = RefO[i];myH[i] = RefH[i];myL[i] = RefL[i];myC[i] = RefC[i];      }for( i = BarCount-1 ; i < BarCount; i++ )      {myO[i] = 3000;myH[i] = 3200;myL[i] = 2900;myC[i] = 3100;      }PlotOHLC( myO, myH, myL, myC, "", colorBlack,styleCandle | styleOwnScale );> Friends,> > I
 seriously doubt this, but has anyone already coded a program to > create a hypothetical security with Tomorrow's Price and to import it > into AmiBroker ?> > If I get some C++, .JS or .VB program I'll like appreciate it very > much.  I can easily do it PERL or Java, but don't want to if I can > avoid it ...> > (... if I don't get any replies, I'll code it tomorrow night ...)> > Regards,> - Salil V GangalTo unsubscribe from this group, send an email to:amibroker-dll-unsubscribe@xxxxxxxxxxxxxxxYour use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Do you Yahoo!?Yahoo! SiteBuilder - Free, easy-to-use web site design software To unsubscribe from this group, send an email to:amibroker-dll-unsubscribe@xxxxxxxxxxxxxxxYour use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.