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

Re: Automatic Execution of Explorations



PureBytes Links

Trading Reference Links



As a reply to both of 
you I'd prepared a complete sample to be a starting point. I hope yahoo allows 
these attachments.
Attached Visual Basic 
program, opens metastock, runs a single test and closes the metastock. In the 
program for certain dialog windows a number is being waited. That is 32770 for 
my pc, probably will be the same for you, if different you'll need microsoft 
spy++ to find the number of a dialog. For running more than one test or an 
optimization a bit complicated programming necessary.
I hope this helps 
you.
 
about a week ago I sent 
following mail but I couldn't get any answer if any one of can help me I'll be 
glad.




<SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi everybody,
<SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 
<SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I wanted to create an indicator ( 
actually i want to redraw the chart ) which will show the closing values, only 
when cumulative volume reaches to certain value. ( each time cum(V) reaches to a 
value it will be reset ) I'd tried by using PREV function but I couldn't 
manage.
<SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 
<SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Any help is 
appreciated,
<SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">taylan



----- Original Message ----- 
<DIV 
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">From: <A 
title=sky40912@xxxxxxxxx href="mailto:sky40912@xxxxxxxxx";>T.E.M. Lockefeer 

To: <A title=metastock@xxxxxxxxxxxxx 
href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx 
Sent: Saturday, March 16, 2002 12:18 
PM
Subject: Re: Automatic Execution of 
Explorations

Very Interesting Taylan !
 
Would you mind sharing the whole script with us 
?
(there is much to be learned in this field and 
there are more ways (AutoIt,VBscripting etc)
 
Als looking for a good Taskscheduler (not At 
command,not W2K taskscheduler, not Wintask (?)
 
Thanks
 
Theo
.
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #008080 2px solid; MARGIN-RIGHT: 0px">
  ----- Original Message ----- 
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">From: 
  Sherwood 
  Hu 
  To: <A title=metastock@xxxxxxxxxxxxx 
  href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx 
  Sent: Saturday, March 16, 2002 11:27 
  PM
  Subject: RE: Automatic Execution of 
  Explorations
  
  
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Taylan<FONT 
  face=Arial color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">,
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> 
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I am new to VB and I 
  tried your code. The VB told me that “function not defined” on <SPAN 
  class=SpellE>FindWindow. How to solve this 
  problem?
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> 
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks,
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Sherwood
  <SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> 
  <SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original 
  Message-----From: <A 
  href="mailto:owner-metastock@xxxxxxxxxxxxx";>owner-metastock@xxxxxxxxxxxxx 
  [mailto:owner-metastock@xxxxxxxxxxxxx] On 
  Behalf Of Taylan Sekerci<SPAN 
  style="FONT-WEIGHT: bold">Sent: Friday, March 15, 2002 2:36 
  AMTo: <A 
  href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx<SPAN 
  style="FONT-WEIGHT: bold">Subject: Re: Automatic Execution of 
  Explorations
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Comic Sans MS" 
  size=2>Yes I do it 
  for, running many system tests at once.  A bit  experimental 
  but I have more than 100 system test (takes about 40 minutes with 550 Mhz 
  machine ), and I run them every night. I just cut, a small part of 
  my Visual Basic automation program, to give you an idea. Following codes runs 
  MS and sets the loading options number of days to 301. As you see this 
  done mainly mimicing key strokes. 
  
  <FONT face="Comic Sans MS" 
  size=2><SPAN 
  style="FONT-SIZE: 10pt; FONT-FAMILY: 'Comic Sans MS'">regards,
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Comic Sans MS" 
  color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">sub 
  small_part()
  
  <FONT face="Comic Sans MS" 
  color=purple size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Comic Sans MS'">MetaStockPath 
  = "C:\Program Files\METASTOCK7\MetaStock"     If 
  Right(MetaStockPath, 1) <> "\" Then MetaStockPath = MetaStockPath & 
  "\"  ' make sure a backslash is at the end of the pathMetaStockRun = 
  MetaStockPath & "MSWIN.EXE"MetaStockRun = Shell(MetaStockRun, 
  vbNormalFocus)Do    DoEvents    
  ReportReady = FindWindow("MetaStockMainWnd", "MetaStock Professional")Loop 
  Until ReportReady <> 0Call wait(0.3)SendKeys "^o", 
  TrueDo    DoEvents    ReportReady = 
  FindWindow("#32770", "Open")Loop Until ReportReady <> 0Call 
  bekle(0.3)'--------------------LOAD OPTIONS DAN YUKLENECEK GUN SAYISI 
  GIRISI-------------If gunyukle = 301 Then    SendKeys 
  "%p", True    SendKeys "l", True    
  Do        
  DoEvents        ReportReady = 
  FindWindow("#32770", "Load Options")    Loop Until 
  ReportReady <> 0    Call 
  bekle(0.2)    SendKeys "301", TrueElse: End 
  If
  
  <FONT face="Comic Sans MS" 
  color=navy size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">end 
  sub()
  
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">.
  
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">----- 
  Original Message ----- 
  
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">From: 
  "Nicholas Kormanik" <<A 
  href="mailto:nkormanik@xxxxxxxxx";><FONT face="Comic Sans MS" color=teal 
  size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">nkormanik@xxxxxxxxx<FONT 
  face="Comic Sans MS" color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">>
  
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">To: 
  <<FONT 
  face="Comic Sans MS" color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">metastock@xxxxxxxxxxxxx<FONT 
  face="Comic Sans MS" color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">>
  
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">Sent: 
  Thursday, March 14, 2002 6:40 PM
  
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">Subject: 
  Automatic Execution of Explorations
  
  <FONT face="Times New Roman" 
  size=3> 
  <FONT face="Comic Sans MS" 
  color=teal size=2><SPAN 
  style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Comic Sans MS'">| | 
  Folks,| | I'd like to be able to set up a desktop 'macro/script/batch 
  language'| that opens MetaStock (7.2), and atomically runs a set of 
  sequential| explorations.| | Do any of you now do that 
  successfully?  If so, how?| | Thanks,| Nicholas| | 
  | | | | 

Attachment: Description: "msauto.vbp"

Attachment: Description: "msauto.frm"

Attachment: Description: "msauto.exe"