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

RE: [amibroker] Script question



PureBytes Links

Trading Reference Links




You 
don't need to have code to do that - you'll need the latest beta and then go 
into the settings window and notice an option for having that message turned 
off.  its on the Report tab - Warn before.... just click it so the check 
mark is off and you're set.
<FONT face=Tahoma color=#0000ff 
size=2> 
<FONT face=Tahoma color=#0000ff 
size=2>d

-----Original Message-----From: 
greg12332000 <greg12332000@xxxxxxxxx> [mailto:greg12332000@xxxxxxxxx] 
Sent: Wednesday, February 19, 2003 7:11 PMTo: 
amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Script 
question
I have been looking into the 
  possibility to run optimisation using the "Backtest.js" script published 
  here by TJ some time ago. I changed some of the script (minor changes) as 
  you can see below, and it does the job. Except when optimisation is too 
  large :-(( The script runs up to AA.Optimize(); where Amibroker says 
  "The formula requires eg. 20,000 optimisation steps. This may take lots of 
  time. Are you sure to proceed Yes/No?" Would it be possible to bypass 
  this somehow, add a line of code into the script, etc. Thanks, 
  Greg/******************************* 
  BatchTest.js** Batch testing sample script* Shows how to use 
  JScript and new AmiBroker 4.23* 'Analysis' object to perform batch 
  backtesting* and generate reports** Created: Dec 21, 2002 TJ* 
  Last modification: Feb 17, 2003 by "me"* * Copyright (C)2002 
  Amibroker.com** Status: Freeware* You can use/modify/adopt this 
  code freely**//* The directory where AFL files are 
  stored** Also reports generated by the bactest** will be saved 
  here*/AFLFolder = "C:\\Test";WScript.Echo("Batch 
  testing of all AFL files stored in " + AFLFolder );var AB, 
  AA;var fso, f, f1, fc, s;var filename;/* Create AmiBroker 
  object and get Analysis object */AB = new 
  ActiveXObject("Broker.Application");AA = AB.Analysis;/* backtest 
  over symbols and all quotes*/AA.ClearFilters(); AA.ApplyTo = 0; // use 
  symbolsAA.RangeMode = 0; // all quotes/* to use filters you should 
  uncomment lines below// AA.ApplyTo = 2; // use filters// 
  AA.Filter(0,"watchlist") = 2 /* watch list number */;// 
  AA.Filter(0,"group") = 0 /* group number */;/* Create 
  FileSystemObject */fso = new 
  ActiveXObject("Scripting.FileSystemObject");/* Iterate through all 
  files in the folder */f = fso.GetFolder(AFLFolder);fc = new 
  Enumerator(f.files);for (; !fc.atEnd(); 
  fc.moveNext()){    // we need to add empty string to 
  make sure that filename is a string object    filename 
  = "" + fc.item();      
        /* check the AFL extension 
  */      if( filename.substr( filename.length - 4 
  ).toUpperCase() == ".AFL" )      
  {         
        if( AA.LoadFormula( filename ) 
  )            
  {            
        
  AA.Optimize();                        
              
        reportname = filename.substr( 0, 
  filename.length - 3 ) + "CSV" ;       
              
        AA.Export( reportname ); // generate 
  report            
  }      }}WScript.Echo("Batch backtest 
  finished");Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT









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.