SVM_v01
Download scriptThis script is designed to integrate a Support Vector Machine (SVM)—a type of machine learning algorithm—into the MetaTrader trading platform. Its primary purpose is to perform automated data classification, specifically tailored for medical diagnostic purposes (as indicated by the "heart" file references).
Here is a breakdown of how the logic functions in non-technical terms:
1. Data Preparation and Storage
The script begins by defining two specific sets of information:
- Training Data: A large collection of historical records (270 entries) that represent known outcomes. This acts as the "textbook" from which the system learns patterns.
- Test Data: A smaller set of new, unknown records. These are used to verify if the system has actually learned how to identify the correct outcome correctly.
When the script starts, it automatically creates two physical files on your computer's C: drive (heart.txt and heart_test.txt). It populates these files with the predefined training and testing information.
2. The Machine Learning Workflow
The script then executes a four-step mathematical process to "teach" the computer how to make decisions:
- Scaling: Raw data often has different ranges (for example, one measurement might be in the hundreds while another is less than one). The script first "scales" this data so that every variable carries equal weight in the final decision.
- Training: Once the data is balanced, the script runs the training algorithm. It analyzes the patterns in the
heart.txtfile to build a mathematical model—essentially creating a set of rules that distinguish between different categories (like "healthy" vs. "unhealthy"). - Testing Scaling: The script then takes the new, unknown test data and applies the exact same balancing (scaling) rules used during the training phase.
- Prediction: Finally, the system feeds the scaled test data into the newly created model. It generates a prediction and saves that result into a final file (
heart_predict.txt).
3. Results Display
After all the calculations are finished, the script reads the final results from the prediction file and converts those values into readable numbers. These results are then displayed directly on your trading chart screen as a comment, showing the classified category for each test case.
Summary of Operation
Instead of a human manually looking at heart data to make a diagnosis, this script automates the entire pipeline: it organizes the records, balances the statistics, builds a custom "intelligence" model based on history, and then applies that intelligence to new data to provide an instant classification.
//+------------------------------------------------------------------+
//| SVM_v01.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
/*
*/
//open mode constants
#define READ 1
#define WRITE 2
#define READWRITE 3
//seek mode constants
#define FILE_BEGIN 0
#define FILE_CURRENT 1
#define FILE_END 2
#import "mtguru1.dll"
int gFileOpen(string file_name,int mode);
bool gFileWrite(int handle,string data);
bool gFileClose(int handle);
string gFileRead(int handle,int length=0);
void gFileSeek(int handle,int offset, int mode);
bool gFileDelete(string file_name);
int gFileSize(int handle);
int SvmScale(double,double,string,string);
int SvmTrain(string, string);
int SvmPredict(string, string, string);
#import
string s1[270];
string s2[2];
//array for test data
void init_s2()
{
s2[0]="+1 1:70.000000 2:1.000000 3:4.000000 4:130.000000 5:322.000000 6:0.000000 7:2.000000 8:109.000000 9:0.000000 10:2.400000 11:2.000000 12:3.000000 13:3.000000";
s2[1]="-1 1:67.000000 2:0.000000 3:3.000000 4:115.000000 5:564.000000 6:0.000000 7:2.000000 8:160.000000 9:0.000000 10:1.600000 11:2.000000 12:0.000000 13:7.000000";
}
//array for train data
void init_s1()
{
s1[0]="+1 1:70.000000 2:1.000000 3:4.000000 4:130.000000 5:322.000000 6:0.000000 7:2.000000 8:109.000000 9:0.000000 10:2.400000 11:2.000000 12:3.000000 13:3.000000";
s1[1]="-1 1:67.000000 2:0.000000 3:3.000000 4:115.000000 5:564.000000 6:0.000000 7:2.000000 8:160.000000 9:0.000000 10:1.600000 11:2.000000 12:0.000000 13:7.000000";
s1[2]="+1 1:57.000000 2:1.000000 3:2.000000 4:124.000000 5:261.000000 6:0.000000 7:0.000000 8:141.000000 9:0.000000 10:0.300000 11:1.000000 12:0.000000 13:7.000000";
s1[3]="-1 1:64.000000 2:1.000000 3:4.000000 4:128.000000 5:263.000000 6:0.000000 7:0.000000 8:105.000000 9:1.000000 10:0.200000 11:2.000000 12:1.000000 13:7.000000";
s1[4]="-1 1:74.000000 2:0.000000 3:2.000000 4:120.000000 5:269.000000 6:0.000000 7:2.000000 8:121.000000 9:1.000000 10:0.200000 11:1.000000 12:1.000000 13:3.000000";
s1[5]="-1 1:65.000000 2:1.000000 3:4.000000 4:120.000000 5:177.000000 6:0.000000 7:0.000000 8:140.000000 9:0.000000 10:0.400000 11:1.000000 12:0.000000 13:7.000000";
s1[6]="+1 1:56.000000 2:1.000000 3:3.000000 4:130.000000 5:256.000000 6:1.000000 7:2.000000 8:142.000000 9:1.000000 10:0.600000 11:2.000000 12:1.000000 13:6.000000";
s1[7]="+1 1:59.000000 2:1.000000 3:4.000000 4:110.000000 5:239.000000 6:0.000000 7:2.000000 8:142.000000 9:1.000000 10:1.200000 11:2.000000 12:1.000000 13:7.000000";
s1[8]="+1 1:60.000000 2:1.000000 3:4.000000 4:140.000000 5:293.000000 6:0.000000 7:2.000000 8:170.000000 9:0.000000 10:1.200000 11:2.000000 12:2.000000 13:7.000000";
s1[9]="+1 1:63.000000 2:0.000000 3:4.000000 4:150.000000 5:407.000000 6:0.000000 7:2.000000 8:154.000000 9:0.000000 10:4.000000 11:2.000000 12:3.000000 13:7.000000";
s1[10]="-1 1:59.000000 2:1.000000 3:4.000000 4:135.000000 5:234.000000 6:0.000000 7:0.000000 8:161.000000 9:0.000000 10:0.500000 11:2.000000 12:0.000000 13:7.000000";
s1[11]="-1 1:53.000000 2:1.000000 3:4.000000 4:142.000000 5:226.000000 6:0.000000 7:2.000000 8:111.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[12]="-1 1:44.000000 2:1.000000 3:3.000000 4:140.000000 5:235.000000 6:0.000000 7:2.000000 8:180.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[13]="+1 1:61.000000 2:1.000000 3:1.000000 4:134.000000 5:234.000000 6:0.000000 7:0.000000 8:145.000000 9:0.000000 10:2.600000 11:2.000000 12:2.000000 13:3.000000";
s1[14]="-1 1:57.000000 2:0.000000 3:4.000000 4:128.000000 5:303.000000 6:0.000000 7:2.000000 8:159.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[15]="-1 1:71.000000 2:0.000000 3:4.000000 4:112.000000 5:149.000000 6:0.000000 7:0.000000 8:125.000000 9:0.000000 10:1.600000 11:2.000000 12:0.000000 13:3.000000";
s1[16]="+1 1:46.000000 2:1.000000 3:4.000000 4:140.000000 5:311.000000 6:0.000000 7:0.000000 8:120.000000 9:1.000000 10:1.800000 11:2.000000 12:2.000000 13:7.000000";
s1[17]="+1 1:53.000000 2:1.000000 3:4.000000 4:140.000000 5:203.000000 6:1.000000 7:2.000000 8:155.000000 9:1.000000 10:3.100000 11:3.000000 12:0.000000 13:7.000000";
s1[18]="-1 1:64.000000 2:1.000000 3:1.000000 4:110.000000 5:211.000000 6:0.000000 7:2.000000 8:144.000000 9:1.000000 10:1.800000 11:2.000000 12:0.000000 13:3.000000";
s1[19]="-1 1:40.000000 2:1.000000 3:1.000000 4:140.000000 5:199.000000 6:0.000000 7:0.000000 8:178.000000 9:1.000000 10:1.400000 11:1.000000 12:0.000000 13:7.000000";
s1[20]="+1 1:67.000000 2:1.000000 3:4.000000 4:120.000000 5:229.000000 6:0.000000 7:2.000000 8:129.000000 9:1.000000 10:2.600000 11:2.000000 12:2.000000 13:7.000000";
s1[21]="-1 1:48.000000 2:1.000000 3:2.000000 4:130.000000 5:245.000000 6:0.000000 7:2.000000 8:180.000000 9:0.000000 10:0.200000 11:2.000000 12:0.000000 13:3.000000";
s1[22]="-1 1:43.000000 2:1.000000 3:4.000000 4:115.000000 5:303.000000 6:0.000000 7:0.000000 8:181.000000 9:0.000000 10:1.200000 11:2.000000 12:0.000000 13:3.000000";
s1[23]="-1 1:47.000000 2:1.000000 3:4.000000 4:112.000000 5:204.000000 6:0.000000 7:0.000000 8:143.000000 9:0.000000 10:0.100000 11:1.000000 12:0.000000 13:3.000000";
s1[24]="-1 1:54.000000 2:0.000000 3:2.000000 4:132.000000 5:288.000000 6:1.000000 7:2.000000 8:159.000000 9:1.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[25]="-1 1:48.000000 2:0.000000 3:3.000000 4:130.000000 5:275.000000 6:0.000000 7:0.000000 8:139.000000 9:0.000000 10:0.200000 11:1.000000 12:0.000000 13:3.000000";
s1[26]="-1 1:46.000000 2:0.000000 3:4.000000 4:138.000000 5:243.000000 6:0.000000 7:2.000000 8:152.000000 9:1.000000 10:0.000000 11:2.000000 12:0.000000 13:3.000000";
s1[27]="-1 1:51.000000 2:0.000000 3:3.000000 4:120.000000 5:295.000000 6:0.000000 7:2.000000 8:157.000000 9:0.000000 10:0.600000 11:1.000000 12:0.000000 13:3.000000";
s1[28]="+1 1:58.000000 2:1.000000 3:3.000000 4:112.000000 5:230.000000 6:0.000000 7:2.000000 8:165.000000 9:0.000000 10:2.500000 11:2.000000 12:1.000000 13:7.000000";
s1[29]="-1 1:71.000000 2:0.000000 3:3.000000 4:110.000000 5:265.000000 6:1.000000 7:2.000000 8:130.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[30]="+1 1:57.000000 2:1.000000 3:3.000000 4:128.000000 5:229.000000 6:0.000000 7:2.000000 8:150.000000 9:0.000000 10:0.400000 11:2.000000 12:1.000000 13:7.000000";
s1[31]="-1 1:66.000000 2:1.000000 3:4.000000 4:160.000000 5:228.000000 6:0.000000 7:2.000000 8:138.000000 9:0.000000 10:2.300000 11:1.000000 12:0.000000 13:6.000000";
s1[32]="-1 1:37.000000 2:0.000000 3:3.000000 4:120.000000 5:215.000000 6:0.000000 7:0.000000 8:170.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[33]="+1 1:59.000000 2:1.000000 3:4.000000 4:170.000000 5:326.000000 6:0.000000 7:2.000000 8:140.000000 9:1.000000 10:3.400000 11:3.000000 12:0.000000 13:7.000000";
s1[34]="+1 1:50.000000 2:1.000000 3:4.000000 4:144.000000 5:200.000000 6:0.000000 7:2.000000 8:126.000000 9:1.000000 10:0.900000 11:2.000000 12:0.000000 13:7.000000";
s1[35]="+1 1:48.000000 2:1.000000 3:4.000000 4:130.000000 5:256.000000 6:1.000000 7:2.000000 8:150.000000 9:1.000000 10:0.000000 11:1.000000 12:2.000000 13:7.000000";
s1[36]="+1 1:61.000000 2:1.000000 3:4.000000 4:140.000000 5:207.000000 6:0.000000 7:2.000000 8:138.000000 9:1.000000 10:1.900000 11:1.000000 12:1.000000 13:7.000000";
s1[37]="+1 1:59.000000 2:1.000000 3:1.000000 4:160.000000 5:273.000000 6:0.000000 7:2.000000 8:125.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[38]="-1 1:42.000000 2:1.000000 3:3.000000 4:130.000000 5:180.000000 6:0.000000 7:0.000000 8:150.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[39]="-1 1:48.000000 2:1.000000 3:4.000000 4:122.000000 5:222.000000 6:0.000000 7:2.000000 8:186.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[40]="+1 1:40.000000 2:1.000000 3:4.000000 4:152.000000 5:223.000000 6:0.000000 7:0.000000 8:181.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[41]="-1 1:62.000000 2:0.000000 3:4.000000 4:124.000000 5:209.000000 6:0.000000 7:0.000000 8:163.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[42]="-1 1:44.000000 2:1.000000 3:3.000000 4:130.000000 5:233.000000 6:0.000000 7:0.000000 8:179.000000 9:1.000000 10:0.400000 11:1.000000 12:0.000000 13:3.000000";
s1[43]="-1 1:46.000000 2:1.000000 3:2.000000 4:101.000000 5:197.000000 6:1.000000 7:0.000000 8:156.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[44]="+1 1:59.000000 2:1.000000 3:3.000000 4:126.000000 5:218.000000 6:1.000000 7:0.000000 8:134.000000 9:0.000000 10:2.200000 11:2.000000 12:1.000000 13:6.000000";
s1[45]="-1 1:58.000000 2:1.000000 3:3.000000 4:140.000000 5:211.000000 6:1.000000 7:2.000000 8:165.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[46]="+1 1:49.000000 2:1.000000 3:3.000000 4:118.000000 5:149.000000 6:0.000000 7:2.000000 8:126.000000 9:0.000000 10:0.800000 11:1.000000 12:3.000000 13:3.000000";
s1[47]="+1 1:44.000000 2:1.000000 3:4.000000 4:110.000000 5:197.000000 6:0.000000 7:2.000000 8:177.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[48]="+1 1:66.000000 2:1.000000 3:2.000000 4:160.000000 5:246.000000 6:0.000000 7:0.000000 8:120.000000 9:1.000000 10:0.000000 11:2.000000 12:3.000000 13:6.000000";
s1[49]="+1 1:65.000000 2:0.000000 3:4.000000 4:150.000000 5:225.000000 6:0.000000 7:2.000000 8:114.000000 9:0.000000 10:1.000000 11:2.000000 12:3.000000 13:7.000000";
s1[50]="+1 1:42.000000 2:1.000000 3:4.000000 4:136.000000 5:315.000000 6:0.000000 7:0.000000 8:125.000000 9:1.000000 10:1.800000 11:2.000000 12:0.000000 13:6.000000";
s1[51]="-1 1:52.000000 2:1.000000 3:2.000000 4:128.000000 5:205.000000 6:1.000000 7:0.000000 8:184.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[52]="-1 1:65.000000 2:0.000000 3:3.000000 4:140.000000 5:417.000000 6:1.000000 7:2.000000 8:157.000000 9:0.000000 10:0.800000 11:1.000000 12:1.000000 13:3.000000";
s1[53]="-1 1:63.000000 2:0.000000 3:2.000000 4:140.000000 5:195.000000 6:0.000000 7:0.000000 8:179.000000 9:0.000000 10:0.000000 11:1.000000 12:2.000000 13:3.000000";
s1[54]="-1 1:45.000000 2:0.000000 3:2.000000 4:130.000000 5:234.000000 6:0.000000 7:2.000000 8:175.000000 9:0.000000 10:0.600000 11:2.000000 12:0.000000 13:3.000000";
s1[55]="-1 1:41.000000 2:0.000000 3:2.000000 4:105.000000 5:198.000000 6:0.000000 7:0.000000 8:168.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[56]="+1 1:61.000000 2:1.000000 3:4.000000 4:138.000000 5:166.000000 6:0.000000 7:2.000000 8:125.000000 9:1.000000 10:3.600000 11:2.000000 12:1.000000 13:3.000000";
s1[57]="-1 1:60.000000 2:0.000000 3:3.000000 4:120.000000 5:178.000000 6:1.000000 7:0.000000 8:96.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[58]="+1 1:59.000000 2:0.000000 3:4.000000 4:174.000000 5:249.000000 6:0.000000 7:0.000000 8:143.000000 9:1.000000 10:0.000000 11:2.000000 12:0.000000 13:3.000000";
s1[59]="+1 1:62.000000 2:1.000000 3:2.000000 4:120.000000 5:281.000000 6:0.000000 7:2.000000 8:103.000000 9:0.000000 10:1.400000 11:2.000000 12:1.000000 13:7.000000";
s1[60]="-1 1:57.000000 2:1.000000 3:3.000000 4:150.000000 5:126.000000 6:1.000000 7:0.000000 8:173.000000 9:0.000000 10:0.200000 11:1.000000 12:1.000000 13:7.000000";
s1[61]="+1 1:51.000000 2:0.000000 3:4.000000 4:130.000000 5:305.000000 6:0.000000 7:0.000000 8:142.000000 9:1.000000 10:1.200000 11:2.000000 12:0.000000 13:7.000000";
s1[62]="-1 1:44.000000 2:1.000000 3:3.000000 4:120.000000 5:226.000000 6:0.000000 7:0.000000 8:169.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[63]="-1 1:60.000000 2:0.000000 3:1.000000 4:150.000000 5:240.000000 6:0.000000 7:0.000000 8:171.000000 9:0.000000 10:0.900000 11:1.000000 12:0.000000 13:3.000000";
s1[64]="-1 1:63.000000 2:1.000000 3:1.000000 4:145.000000 5:233.000000 6:1.000000 7:2.000000 8:150.000000 9:0.000000 10:2.300000 11:3.000000 12:0.000000 13:6.000000";
s1[65]="+1 1:57.000000 2:1.000000 3:4.000000 4:150.000000 5:276.000000 6:0.000000 7:2.000000 8:112.000000 9:1.000000 10:0.600000 11:2.000000 12:1.000000 13:6.000000";
s1[66]="-1 1:51.000000 2:1.000000 3:4.000000 4:140.000000 5:261.000000 6:0.000000 7:2.000000 8:186.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[67]="+1 1:58.000000 2:0.000000 3:2.000000 4:136.000000 5:319.000000 6:1.000000 7:2.000000 8:152.000000 9:0.000000 10:0.000000 11:1.000000 12:2.000000 13:3.000000";
s1[68]="-1 1:44.000000 2:0.000000 3:3.000000 4:118.000000 5:242.000000 6:0.000000 7:0.000000 8:149.000000 9:0.000000 10:0.300000 11:2.000000 12:1.000000 13:3.000000";
s1[69]="+1 1:47.000000 2:1.000000 3:3.000000 4:108.000000 5:243.000000 6:0.000000 7:0.000000 8:152.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[70]="+1 1:61.000000 2:1.000000 3:4.000000 4:120.000000 5:260.000000 6:0.000000 7:0.000000 8:140.000000 9:1.000000 10:3.600000 11:2.000000 12:1.000000 13:7.000000";
s1[71]="-1 1:57.000000 2:0.000000 3:4.000000 4:120.000000 5:354.000000 6:0.000000 7:0.000000 8:163.000000 9:1.000000 10:0.600000 11:1.000000 12:0.000000 13:3.000000";
s1[72]="-1 1:70.000000 2:1.000000 3:2.000000 4:156.000000 5:245.000000 6:0.000000 7:2.000000 8:143.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[73]="-1 1:76.000000 2:0.000000 3:3.000000 4:140.000000 5:197.000000 6:0.000000 7:1.000000 8:116.000000 9:0.000000 10:1.100000 11:2.000000 12:0.000000 13:3.000000";
s1[74]="-1 1:67.000000 2:0.000000 3:4.000000 4:106.000000 5:223.000000 6:0.000000 7:0.000000 8:142.000000 9:0.000000 10:0.300000 11:1.000000 12:2.000000 13:3.000000";
s1[75]="+1 1:45.000000 2:1.000000 3:4.000000 4:142.000000 5:309.000000 6:0.000000 7:2.000000 8:147.000000 9:1.000000 10:0.000000 11:2.000000 12:3.000000 13:7.000000";
s1[76]="-1 1:45.000000 2:1.000000 3:4.000000 4:104.000000 5:208.000000 6:0.000000 7:2.000000 8:148.000000 9:1.000000 10:3.000000 11:2.000000 12:0.000000 13:3.000000";
s1[77]="-1 1:39.000000 2:0.000000 3:3.000000 4:94.000000 5:199.000000 6:0.000000 7:0.000000 8:179.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[78]="-1 1:42.000000 2:0.000000 3:3.000000 4:120.000000 5:209.000000 6:0.000000 7:0.000000 8:173.000000 9:0.000000 10:0.000000 11:2.000000 12:0.000000 13:3.000000";
s1[79]="-1 1:56.000000 2:1.000000 3:2.000000 4:120.000000 5:236.000000 6:0.000000 7:0.000000 8:178.000000 9:0.000000 10:0.800000 11:1.000000 12:0.000000 13:3.000000";
s1[80]="+1 1:58.000000 2:1.000000 3:4.000000 4:146.000000 5:218.000000 6:0.000000 7:0.000000 8:105.000000 9:0.000000 10:2.000000 11:2.000000 12:1.000000 13:7.000000";
s1[81]="+1 1:35.000000 2:1.000000 3:4.000000 4:120.000000 5:198.000000 6:0.000000 7:0.000000 8:130.000000 9:1.000000 10:1.600000 11:2.000000 12:0.000000 13:7.000000";
s1[82]="+1 1:58.000000 2:1.000000 3:4.000000 4:150.000000 5:270.000000 6:0.000000 7:2.000000 8:111.000000 9:1.000000 10:0.800000 11:1.000000 12:0.000000 13:7.000000";
s1[83]="-1 1:41.000000 2:1.000000 3:3.000000 4:130.000000 5:214.000000 6:0.000000 7:2.000000 8:168.000000 9:0.000000 10:2.000000 11:2.000000 12:0.000000 13:3.000000";
s1[84]="-1 1:57.000000 2:1.000000 3:4.000000 4:110.000000 5:201.000000 6:0.000000 7:0.000000 8:126.000000 9:1.000000 10:1.500000 11:2.000000 12:0.000000 13:6.000000";
s1[85]="-1 1:42.000000 2:1.000000 3:1.000000 4:148.000000 5:244.000000 6:0.000000 7:2.000000 8:178.000000 9:0.000000 10:0.800000 11:1.000000 12:2.000000 13:3.000000";
s1[86]="-1 1:62.000000 2:1.000000 3:2.000000 4:128.000000 5:208.000000 6:1.000000 7:2.000000 8:140.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[87]="-1 1:59.000000 2:1.000000 3:1.000000 4:178.000000 5:270.000000 6:0.000000 7:2.000000 8:145.000000 9:0.000000 10:4.200000 11:3.000000 12:0.000000 13:7.000000";
s1[88]="-1 1:41.000000 2:0.000000 3:2.000000 4:126.000000 5:306.000000 6:0.000000 7:0.000000 8:163.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[89]="+1 1:50.000000 2:1.000000 3:4.000000 4:150.000000 5:243.000000 6:0.000000 7:2.000000 8:128.000000 9:0.000000 10:2.600000 11:2.000000 12:0.000000 13:7.000000";
s1[90]="-1 1:59.000000 2:1.000000 3:2.000000 4:140.000000 5:221.000000 6:0.000000 7:0.000000 8:164.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[91]="+1 1:61.000000 2:0.000000 3:4.000000 4:130.000000 5:330.000000 6:0.000000 7:2.000000 8:169.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[92]="+1 1:54.000000 2:1.000000 3:4.000000 4:124.000000 5:266.000000 6:0.000000 7:2.000000 8:109.000000 9:1.000000 10:2.200000 11:2.000000 12:1.000000 13:7.000000";
s1[93]="+1 1:54.000000 2:1.000000 3:4.000000 4:110.000000 5:206.000000 6:0.000000 7:2.000000 8:108.000000 9:1.000000 10:0.000000 11:2.000000 12:1.000000 13:3.000000";
s1[94]="+1 1:52.000000 2:1.000000 3:4.000000 4:125.000000 5:212.000000 6:0.000000 7:0.000000 8:168.000000 9:0.000000 10:1.000000 11:1.000000 12:2.000000 13:7.000000";
s1[95]="+1 1:47.000000 2:1.000000 3:4.000000 4:110.000000 5:275.000000 6:0.000000 7:2.000000 8:118.000000 9:1.000000 10:1.000000 11:2.000000 12:1.000000 13:3.000000";
s1[96]="-1 1:66.000000 2:1.000000 3:4.000000 4:120.000000 5:302.000000 6:0.000000 7:2.000000 8:151.000000 9:0.000000 10:0.400000 11:2.000000 12:0.000000 13:3.000000";
s1[97]="+1 1:58.000000 2:1.000000 3:4.000000 4:100.000000 5:234.000000 6:0.000000 7:0.000000 8:156.000000 9:0.000000 10:0.100000 11:1.000000 12:1.000000 13:7.000000";
s1[98]="-1 1:64.000000 2:0.000000 3:3.000000 4:140.000000 5:313.000000 6:0.000000 7:0.000000 8:133.000000 9:0.000000 10:0.200000 11:1.000000 12:0.000000 13:7.000000";
s1[99]="-1 1:50.000000 2:0.000000 3:2.000000 4:120.000000 5:244.000000 6:0.000000 7:0.000000 8:162.000000 9:0.000000 10:1.100000 11:1.000000 12:0.000000 13:3.000000";
s1[100]="-1 1:44.000000 2:0.000000 3:3.000000 4:108.000000 5:141.000000 6:0.000000 7:0.000000 8:175.000000 9:0.000000 10:0.600000 11:2.000000 12:0.000000 13:3.000000";
s1[101]="+1 1:67.000000 2:1.000000 3:4.000000 4:120.000000 5:237.000000 6:0.000000 7:0.000000 8:71.000000 9:0.000000 10:1.000000 11:2.000000 12:0.000000 13:3.000000";
s1[102]="-1 1:49.000000 2:0.000000 3:4.000000 4:130.000000 5:269.000000 6:0.000000 7:0.000000 8:163.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[103]="+1 1:57.000000 2:1.000000 3:4.000000 4:165.000000 5:289.000000 6:1.000000 7:2.000000 8:124.000000 9:0.000000 10:1.000000 11:2.000000 12:3.000000 13:7.000000";
s1[104]="+1 1:63.000000 2:1.000000 3:4.000000 4:130.000000 5:254.000000 6:0.000000 7:2.000000 8:147.000000 9:0.000000 10:1.400000 11:2.000000 12:1.000000 13:7.000000";
s1[105]="+1 1:48.000000 2:1.000000 3:4.000000 4:124.000000 5:274.000000 6:0.000000 7:2.000000 8:166.000000 9:0.000000 10:0.500000 11:2.000000 12:0.000000 13:7.000000";
s1[106]="-1 1:51.000000 2:1.000000 3:3.000000 4:100.000000 5:222.000000 6:0.000000 7:0.000000 8:143.000000 9:1.000000 10:1.200000 11:2.000000 12:0.000000 13:3.000000";
s1[107]="+1 1:60.000000 2:0.000000 3:4.000000 4:150.000000 5:258.000000 6:0.000000 7:2.000000 8:157.000000 9:0.000000 10:2.600000 11:2.000000 12:2.000000 13:7.000000";
s1[108]="+1 1:59.000000 2:1.000000 3:4.000000 4:140.000000 5:177.000000 6:0.000000 7:0.000000 8:162.000000 9:1.000000 10:0.000000 11:1.000000 12:1.000000 13:7.000000";
s1[109]="-1 1:45.000000 2:0.000000 3:2.000000 4:112.000000 5:160.000000 6:0.000000 7:0.000000 8:138.000000 9:0.000000 10:0.000000 11:2.000000 12:0.000000 13:3.000000";
s1[110]="+1 1:55.000000 2:0.000000 3:4.000000 4:180.000000 5:327.000000 6:0.000000 7:1.000000 8:117.000000 9:1.000000 10:3.400000 11:2.000000 12:0.000000 13:3.000000";
s1[111]="-1 1:41.000000 2:1.000000 3:2.000000 4:110.000000 5:235.000000 6:0.000000 7:0.000000 8:153.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[112]="+1 1:60.000000 2:0.000000 3:4.000000 4:158.000000 5:305.000000 6:0.000000 7:2.000000 8:161.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[113]="-1 1:54.000000 2:0.000000 3:3.000000 4:135.000000 5:304.000000 6:1.000000 7:0.000000 8:170.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[114]="-1 1:42.000000 2:1.000000 3:2.000000 4:120.000000 5:295.000000 6:0.000000 7:0.000000 8:162.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[115]="-1 1:49.000000 2:0.000000 3:2.000000 4:134.000000 5:271.000000 6:0.000000 7:0.000000 8:162.000000 9:0.000000 10:0.000000 11:2.000000 12:0.000000 13:3.000000";
s1[116]="+1 1:46.000000 2:1.000000 3:4.000000 4:120.000000 5:249.000000 6:0.000000 7:2.000000 8:144.000000 9:0.000000 10:0.800000 11:1.000000 12:0.000000 13:7.000000";
s1[117]="+1 1:56.000000 2:0.000000 3:4.000000 4:200.000000 5:288.000000 6:1.000000 7:2.000000 8:133.000000 9:1.000000 10:4.000000 11:3.000000 12:2.000000 13:7.000000";
s1[118]="-1 1:66.000000 2:0.000000 3:1.000000 4:150.000000 5:226.000000 6:0.000000 7:0.000000 8:114.000000 9:0.000000 10:2.600000 11:3.000000 12:0.000000 13:3.000000";
s1[119]="+1 1:56.000000 2:1.000000 3:4.000000 4:130.000000 5:283.000000 6:1.000000 7:2.000000 8:103.000000 9:1.000000 10:1.600000 11:3.000000 12:0.000000 13:7.000000";
s1[120]="+1 1:49.000000 2:1.000000 3:3.000000 4:120.000000 5:188.000000 6:0.000000 7:0.000000 8:139.000000 9:0.000000 10:2.000000 11:2.000000 12:3.000000 13:7.000000";
s1[121]="+1 1:54.000000 2:1.000000 3:4.000000 4:122.000000 5:286.000000 6:0.000000 7:2.000000 8:116.000000 9:1.000000 10:3.200000 11:2.000000 12:2.000000 13:3.000000";
s1[122]="+1 1:57.000000 2:1.000000 3:4.000000 4:152.000000 5:274.000000 6:0.000000 7:0.000000 8:88.000000 9:1.000000 10:1.200000 11:2.000000 12:1.000000 13:7.000000";
s1[123]="-1 1:65.000000 2:0.000000 3:3.000000 4:160.000000 5:360.000000 6:0.000000 7:2.000000 8:151.000000 9:0.000000 10:0.800000 11:1.000000 12:0.000000 13:3.000000";
s1[124]="-1 1:54.000000 2:1.000000 3:3.000000 4:125.000000 5:273.000000 6:0.000000 7:2.000000 8:152.000000 9:0.000000 10:0.500000 11:3.000000 12:1.000000 13:3.000000";
s1[125]="-1 1:54.000000 2:0.000000 3:3.000000 4:160.000000 5:201.000000 6:0.000000 7:0.000000 8:163.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[126]="+1 1:62.000000 2:1.000000 3:4.000000 4:120.000000 5:267.000000 6:0.000000 7:0.000000 8:99.000000 9:1.000000 10:1.800000 11:2.000000 12:2.000000 13:7.000000";
s1[127]="-1 1:52.000000 2:0.000000 3:3.000000 4:136.000000 5:196.000000 6:0.000000 7:2.000000 8:169.000000 9:0.000000 10:0.100000 11:2.000000 12:0.000000 13:3.000000";
s1[128]="-1 1:52.000000 2:1.000000 3:2.000000 4:134.000000 5:201.000000 6:0.000000 7:0.000000 8:158.000000 9:0.000000 10:0.800000 11:1.000000 12:1.000000 13:3.000000";
s1[129]="+1 1:60.000000 2:1.000000 3:4.000000 4:117.000000 5:230.000000 6:1.000000 7:0.000000 8:160.000000 9:1.000000 10:1.400000 11:1.000000 12:2.000000 13:7.000000";
s1[130]="+1 1:63.000000 2:0.000000 3:4.000000 4:108.000000 5:269.000000 6:0.000000 7:0.000000 8:169.000000 9:1.000000 10:1.800000 11:2.000000 12:2.000000 13:3.000000";
s1[131]="+1 1:66.000000 2:1.000000 3:4.000000 4:112.000000 5:212.000000 6:0.000000 7:2.000000 8:132.000000 9:1.000000 10:0.100000 11:1.000000 12:1.000000 13:3.000000";
s1[132]="-1 1:42.000000 2:1.000000 3:4.000000 4:140.000000 5:226.000000 6:0.000000 7:0.000000 8:178.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[133]="+1 1:64.000000 2:1.000000 3:4.000000 4:120.000000 5:246.000000 6:0.000000 7:2.000000 8:96.000000 9:1.000000 10:2.200000 11:3.000000 12:1.000000 13:3.000000";
s1[134]="-1 1:54.000000 2:1.000000 3:3.000000 4:150.000000 5:232.000000 6:0.000000 7:2.000000 8:165.000000 9:0.000000 10:1.600000 11:1.000000 12:0.000000 13:7.000000";
s1[135]="-1 1:46.000000 2:0.000000 3:3.000000 4:142.000000 5:177.000000 6:0.000000 7:2.000000 8:160.000000 9:1.000000 10:1.400000 11:3.000000 12:0.000000 13:3.000000";
s1[136]="-1 1:67.000000 2:0.000000 3:3.000000 4:152.000000 5:277.000000 6:0.000000 7:0.000000 8:172.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[137]="+1 1:56.000000 2:1.000000 3:4.000000 4:125.000000 5:249.000000 6:1.000000 7:2.000000 8:144.000000 9:1.000000 10:1.200000 11:2.000000 12:1.000000 13:3.000000";
s1[138]="-1 1:34.000000 2:0.000000 3:2.000000 4:118.000000 5:210.000000 6:0.000000 7:0.000000 8:192.000000 9:0.000000 10:0.700000 11:1.000000 12:0.000000 13:3.000000";
s1[139]="-1 1:57.000000 2:1.000000 3:4.000000 4:132.000000 5:207.000000 6:0.000000 7:0.000000 8:168.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[140]="+1 1:64.000000 2:1.000000 3:4.000000 4:145.000000 5:212.000000 6:0.000000 7:2.000000 8:132.000000 9:0.000000 10:2.000000 11:2.000000 12:2.000000 13:6.000000";
s1[141]="-1 1:59.000000 2:1.000000 3:4.000000 4:138.000000 5:271.000000 6:0.000000 7:2.000000 8:182.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[142]="+1 1:50.000000 2:1.000000 3:3.000000 4:140.000000 5:233.000000 6:0.000000 7:0.000000 8:163.000000 9:0.000000 10:0.600000 11:2.000000 12:1.000000 13:7.000000";
s1[143]="-1 1:51.000000 2:1.000000 3:1.000000 4:125.000000 5:213.000000 6:0.000000 7:2.000000 8:125.000000 9:1.000000 10:1.400000 11:1.000000 12:1.000000 13:3.000000";
s1[144]="+1 1:54.000000 2:1.000000 3:2.000000 4:192.000000 5:283.000000 6:0.000000 7:2.000000 8:195.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:7.000000";
s1[145]="+1 1:53.000000 2:1.000000 3:4.000000 4:123.000000 5:282.000000 6:0.000000 7:0.000000 8:95.000000 9:1.000000 10:2.000000 11:2.000000 12:2.000000 13:7.000000";
s1[146]="+1 1:52.000000 2:1.000000 3:4.000000 4:112.000000 5:230.000000 6:0.000000 7:0.000000 8:160.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[147]="+1 1:40.000000 2:1.000000 3:4.000000 4:110.000000 5:167.000000 6:0.000000 7:2.000000 8:114.000000 9:1.000000 10:2.000000 11:2.000000 12:0.000000 13:7.000000";
s1[148]="+1 1:58.000000 2:1.000000 3:3.000000 4:132.000000 5:224.000000 6:0.000000 7:2.000000 8:173.000000 9:0.000000 10:3.200000 11:1.000000 12:2.000000 13:7.000000";
s1[149]="-1 1:41.000000 2:0.000000 3:3.000000 4:112.000000 5:268.000000 6:0.000000 7:2.000000 8:172.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[150]="-1 1:41.000000 2:1.000000 3:3.000000 4:112.000000 5:250.000000 6:0.000000 7:0.000000 8:179.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[151]="-1 1:50.000000 2:0.000000 3:3.000000 4:120.000000 5:219.000000 6:0.000000 7:0.000000 8:158.000000 9:0.000000 10:1.600000 11:2.000000 12:0.000000 13:3.000000";
s1[152]="-1 1:54.000000 2:0.000000 3:3.000000 4:108.000000 5:267.000000 6:0.000000 7:2.000000 8:167.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[153]="-1 1:64.000000 2:0.000000 3:4.000000 4:130.000000 5:303.000000 6:0.000000 7:0.000000 8:122.000000 9:0.000000 10:2.000000 11:2.000000 12:2.000000 13:3.000000";
s1[154]="-1 1:51.000000 2:0.000000 3:3.000000 4:130.000000 5:256.000000 6:0.000000 7:2.000000 8:149.000000 9:0.000000 10:0.500000 11:1.000000 12:0.000000 13:3.000000";
s1[155]="-1 1:46.000000 2:0.000000 3:2.000000 4:105.000000 5:204.000000 6:0.000000 7:0.000000 8:172.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[156]="+1 1:55.000000 2:1.000000 3:4.000000 4:140.000000 5:217.000000 6:0.000000 7:0.000000 8:111.000000 9:1.000000 10:5.600000 11:3.000000 12:0.000000 13:7.000000";
s1[157]="-1 1:45.000000 2:1.000000 3:2.000000 4:128.000000 5:308.000000 6:0.000000 7:2.000000 8:170.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[158]="-1 1:56.000000 2:1.000000 3:1.000000 4:120.000000 5:193.000000 6:0.000000 7:2.000000 8:162.000000 9:0.000000 10:1.900000 11:2.000000 12:0.000000 13:7.000000";
s1[159]="+1 1:66.000000 2:0.000000 3:4.000000 4:178.000000 5:228.000000 6:1.000000 7:0.000000 8:165.000000 9:1.000000 10:1.000000 11:2.000000 12:2.000000 13:7.000000";
s1[160]="+1 1:38.000000 2:1.000000 3:1.000000 4:120.000000 5:231.000000 6:0.000000 7:0.000000 8:182.000000 9:1.000000 10:3.800000 11:2.000000 12:0.000000 13:7.000000";
s1[161]="+1 1:62.000000 2:0.000000 3:4.000000 4:150.000000 5:244.000000 6:0.000000 7:0.000000 8:154.000000 9:1.000000 10:1.400000 11:2.000000 12:0.000000 13:3.000000";
s1[162]="-1 1:55.000000 2:1.000000 3:2.000000 4:130.000000 5:262.000000 6:0.000000 7:0.000000 8:155.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[163]="+1 1:58.000000 2:1.000000 3:4.000000 4:128.000000 5:259.000000 6:0.000000 7:2.000000 8:130.000000 9:1.000000 10:3.000000 11:2.000000 12:2.000000 13:7.000000";
s1[164]="-1 1:43.000000 2:1.000000 3:4.000000 4:110.000000 5:211.000000 6:0.000000 7:0.000000 8:161.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[165]="-1 1:64.000000 2:0.000000 3:4.000000 4:180.000000 5:325.000000 6:0.000000 7:0.000000 8:154.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[166]="-1 1:50.000000 2:0.000000 3:4.000000 4:110.000000 5:254.000000 6:0.000000 7:2.000000 8:159.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[167]="-1 1:53.000000 2:1.000000 3:3.000000 4:130.000000 5:197.000000 6:1.000000 7:2.000000 8:152.000000 9:0.000000 10:1.200000 11:3.000000 12:0.000000 13:3.000000";
s1[168]="-1 1:45.000000 2:0.000000 3:4.000000 4:138.000000 5:236.000000 6:0.000000 7:2.000000 8:152.000000 9:1.000000 10:0.200000 11:2.000000 12:0.000000 13:3.000000";
s1[169]="+1 1:65.000000 2:1.000000 3:1.000000 4:138.000000 5:282.000000 6:1.000000 7:2.000000 8:174.000000 9:0.000000 10:1.400000 11:2.000000 12:1.000000 13:3.000000";
s1[170]="-1 1:69.000000 2:1.000000 3:1.000000 4:160.000000 5:234.000000 6:1.000000 7:2.000000 8:131.000000 9:0.000000 10:0.100000 11:2.000000 12:1.000000 13:3.000000";
s1[171]="+1 1:69.000000 2:1.000000 3:3.000000 4:140.000000 5:254.000000 6:0.000000 7:2.000000 8:146.000000 9:0.000000 10:2.000000 11:2.000000 12:3.000000 13:7.000000";
s1[172]="+1 1:67.000000 2:1.000000 3:4.000000 4:100.000000 5:299.000000 6:0.000000 7:2.000000 8:125.000000 9:1.000000 10:0.900000 11:2.000000 12:2.000000 13:3.000000";
s1[173]="-1 1:68.000000 2:0.000000 3:3.000000 4:120.000000 5:211.000000 6:0.000000 7:2.000000 8:115.000000 9:0.000000 10:1.500000 11:2.000000 12:0.000000 13:3.000000";
s1[174]="-1 1:34.000000 2:1.000000 3:1.000000 4:118.000000 5:182.000000 6:0.000000 7:2.000000 8:174.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[175]="+1 1:62.000000 2:0.000000 3:4.000000 4:138.000000 5:294.000000 6:1.000000 7:0.000000 8:106.000000 9:0.000000 10:1.900000 11:2.000000 12:3.000000 13:3.000000";
s1[176]="+1 1:51.000000 2:1.000000 3:4.000000 4:140.000000 5:298.000000 6:0.000000 7:0.000000 8:122.000000 9:1.000000 10:4.200000 11:2.000000 12:3.000000 13:7.000000";
s1[177]="+1 1:46.000000 2:1.000000 3:3.000000 4:150.000000 5:231.000000 6:0.000000 7:0.000000 8:147.000000 9:0.000000 10:3.600000 11:2.000000 12:0.000000 13:3.000000";
s1[178]="+1 1:67.000000 2:1.000000 3:4.000000 4:125.000000 5:254.000000 6:1.000000 7:0.000000 8:163.000000 9:0.000000 10:0.200000 11:2.000000 12:2.000000 13:7.000000";
s1[179]="-1 1:50.000000 2:1.000000 3:3.000000 4:129.000000 5:196.000000 6:0.000000 7:0.000000 8:163.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[180]="-1 1:42.000000 2:1.000000 3:3.000000 4:120.000000 5:240.000000 6:1.000000 7:0.000000 8:194.000000 9:0.000000 10:0.800000 11:3.000000 12:0.000000 13:7.000000";
s1[181]="+1 1:56.000000 2:0.000000 3:4.000000 4:134.000000 5:409.000000 6:0.000000 7:2.000000 8:150.000000 9:1.000000 10:1.900000 11:2.000000 12:2.000000 13:7.000000";
s1[182]="+1 1:41.000000 2:1.000000 3:4.000000 4:110.000000 5:172.000000 6:0.000000 7:2.000000 8:158.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[183]="-1 1:42.000000 2:0.000000 3:4.000000 4:102.000000 5:265.000000 6:0.000000 7:2.000000 8:122.000000 9:0.000000 10:0.600000 11:2.000000 12:0.000000 13:3.000000";
s1[184]="-1 1:53.000000 2:1.000000 3:3.000000 4:130.000000 5:246.000000 6:1.000000 7:2.000000 8:173.000000 9:0.000000 10:0.000000 11:1.000000 12:3.000000 13:3.000000";
s1[185]="-1 1:43.000000 2:1.000000 3:3.000000 4:130.000000 5:315.000000 6:0.000000 7:0.000000 8:162.000000 9:0.000000 10:1.900000 11:1.000000 12:1.000000 13:3.000000";
s1[186]="+1 1:56.000000 2:1.000000 3:4.000000 4:132.000000 5:184.000000 6:0.000000 7:2.000000 8:105.000000 9:1.000000 10:2.100000 11:2.000000 12:1.000000 13:6.000000";
s1[187]="-1 1:52.000000 2:1.000000 3:4.000000 4:108.000000 5:233.000000 6:1.000000 7:0.000000 8:147.000000 9:0.000000 10:0.100000 11:1.000000 12:3.000000 13:7.000000";
s1[188]="-1 1:62.000000 2:0.000000 3:4.000000 4:140.000000 5:394.000000 6:0.000000 7:2.000000 8:157.000000 9:0.000000 10:1.200000 11:2.000000 12:0.000000 13:3.000000";
s1[189]="+1 1:70.000000 2:1.000000 3:3.000000 4:160.000000 5:269.000000 6:0.000000 7:0.000000 8:112.000000 9:1.000000 10:2.900000 11:2.000000 12:1.000000 13:7.000000";
s1[190]="-1 1:54.000000 2:1.000000 3:4.000000 4:140.000000 5:239.000000 6:0.000000 7:0.000000 8:160.000000 9:0.000000 10:1.200000 11:1.000000 12:0.000000 13:3.000000";
s1[191]="+1 1:70.000000 2:1.000000 3:4.000000 4:145.000000 5:174.000000 6:0.000000 7:0.000000 8:125.000000 9:1.000000 10:2.600000 11:3.000000 12:0.000000 13:7.000000";
s1[192]="-1 1:54.000000 2:1.000000 3:2.000000 4:108.000000 5:309.000000 6:0.000000 7:0.000000 8:156.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[193]="+1 1:35.000000 2:1.000000 3:4.000000 4:126.000000 5:282.000000 6:0.000000 7:2.000000 8:156.000000 9:1.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[194]="-1 1:48.000000 2:1.000000 3:3.000000 4:124.000000 5:255.000000 6:1.000000 7:0.000000 8:175.000000 9:0.000000 10:0.000000 11:1.000000 12:2.000000 13:3.000000";
s1[195]="-1 1:55.000000 2:0.000000 3:2.000000 4:135.000000 5:250.000000 6:0.000000 7:2.000000 8:161.000000 9:0.000000 10:1.400000 11:2.000000 12:0.000000 13:3.000000";
s1[196]="-1 1:58.000000 2:0.000000 3:4.000000 4:100.000000 5:248.000000 6:0.000000 7:2.000000 8:122.000000 9:0.000000 10:1.000000 11:2.000000 12:0.000000 13:3.000000";
s1[197]="-1 1:54.000000 2:0.000000 3:3.000000 4:110.000000 5:214.000000 6:0.000000 7:0.000000 8:158.000000 9:0.000000 10:1.600000 11:2.000000 12:0.000000 13:3.000000";
s1[198]="-1 1:69.000000 2:0.000000 3:1.000000 4:140.000000 5:239.000000 6:0.000000 7:0.000000 8:151.000000 9:0.000000 10:1.800000 11:1.000000 12:2.000000 13:3.000000";
s1[199]="+1 1:77.000000 2:1.000000 3:4.000000 4:125.000000 5:304.000000 6:0.000000 7:2.000000 8:162.000000 9:1.000000 10:0.000000 11:1.000000 12:3.000000 13:3.000000";
s1[200]="-1 1:68.000000 2:1.000000 3:3.000000 4:118.000000 5:277.000000 6:0.000000 7:0.000000 8:151.000000 9:0.000000 10:1.000000 11:1.000000 12:1.000000 13:7.000000";
s1[201]="+1 1:58.000000 2:1.000000 3:4.000000 4:125.000000 5:300.000000 6:0.000000 7:2.000000 8:171.000000 9:0.000000 10:0.000000 11:1.000000 12:2.000000 13:7.000000";
s1[202]="+1 1:60.000000 2:1.000000 3:4.000000 4:125.000000 5:258.000000 6:0.000000 7:2.000000 8:141.000000 9:1.000000 10:2.800000 11:2.000000 12:1.000000 13:7.000000";
s1[203]="+1 1:51.000000 2:1.000000 3:4.000000 4:140.000000 5:299.000000 6:0.000000 7:0.000000 8:173.000000 9:1.000000 10:1.600000 11:1.000000 12:0.000000 13:7.000000";
s1[204]="+1 1:55.000000 2:1.000000 3:4.000000 4:160.000000 5:289.000000 6:0.000000 7:2.000000 8:145.000000 9:1.000000 10:0.800000 11:2.000000 12:1.000000 13:7.000000";
s1[205]="-1 1:52.000000 2:1.000000 3:1.000000 4:152.000000 5:298.000000 6:1.000000 7:0.000000 8:178.000000 9:0.000000 10:1.200000 11:2.000000 12:0.000000 13:7.000000";
s1[206]="-1 1:60.000000 2:0.000000 3:3.000000 4:102.000000 5:318.000000 6:0.000000 7:0.000000 8:160.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[207]="-1 1:58.000000 2:1.000000 3:3.000000 4:105.000000 5:240.000000 6:0.000000 7:2.000000 8:154.000000 9:1.000000 10:0.600000 11:2.000000 12:0.000000 13:7.000000";
s1[208]="+1 1:64.000000 2:1.000000 3:3.000000 4:125.000000 5:309.000000 6:0.000000 7:0.000000 8:131.000000 9:1.000000 10:1.800000 11:2.000000 12:0.000000 13:7.000000";
s1[209]="-1 1:37.000000 2:1.000000 3:3.000000 4:130.000000 5:250.000000 6:0.000000 7:0.000000 8:187.000000 9:0.000000 10:3.500000 11:3.000000 12:0.000000 13:3.000000";
s1[210]="+1 1:59.000000 2:1.000000 3:1.000000 4:170.000000 5:288.000000 6:0.000000 7:2.000000 8:159.000000 9:0.000000 10:0.200000 11:2.000000 12:0.000000 13:7.000000";
s1[211]="-1 1:51.000000 2:1.000000 3:3.000000 4:125.000000 5:245.000000 6:1.000000 7:2.000000 8:166.000000 9:0.000000 10:2.400000 11:2.000000 12:0.000000 13:3.000000";
s1[212]="-1 1:43.000000 2:0.000000 3:3.000000 4:122.000000 5:213.000000 6:0.000000 7:0.000000 8:165.000000 9:0.000000 10:0.200000 11:2.000000 12:0.000000 13:3.000000";
s1[213]="+1 1:58.000000 2:1.000000 3:4.000000 4:128.000000 5:216.000000 6:0.000000 7:2.000000 8:131.000000 9:1.000000 10:2.200000 11:2.000000 12:3.000000 13:7.000000";
s1[214]="-1 1:29.000000 2:1.000000 3:2.000000 4:130.000000 5:204.000000 6:0.000000 7:2.000000 8:202.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[215]="-1 1:41.000000 2:0.000000 3:2.000000 4:130.000000 5:204.000000 6:0.000000 7:2.000000 8:172.000000 9:0.000000 10:1.400000 11:1.000000 12:0.000000 13:3.000000";
s1[216]="-1 1:63.000000 2:0.000000 3:3.000000 4:135.000000 5:252.000000 6:0.000000 7:2.000000 8:172.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[217]="-1 1:51.000000 2:1.000000 3:3.000000 4:94.000000 5:227.000000 6:0.000000 7:0.000000 8:154.000000 9:1.000000 10:0.000000 11:1.000000 12:1.000000 13:7.000000";
s1[218]="-1 1:54.000000 2:1.000000 3:3.000000 4:120.000000 5:258.000000 6:0.000000 7:2.000000 8:147.000000 9:0.000000 10:0.400000 11:2.000000 12:0.000000 13:7.000000";
s1[219]="-1 1:44.000000 2:1.000000 3:2.000000 4:120.000000 5:220.000000 6:0.000000 7:0.000000 8:170.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[220]="+1 1:54.000000 2:1.000000 3:4.000000 4:110.000000 5:239.000000 6:0.000000 7:0.000000 8:126.000000 9:1.000000 10:2.800000 11:2.000000 12:1.000000 13:7.000000";
s1[221]="+1 1:65.000000 2:1.000000 3:4.000000 4:135.000000 5:254.000000 6:0.000000 7:2.000000 8:127.000000 9:0.000000 10:2.800000 11:2.000000 12:1.000000 13:7.000000";
s1[222]="-1 1:57.000000 2:1.000000 3:3.000000 4:150.000000 5:168.000000 6:0.000000 7:0.000000 8:174.000000 9:0.000000 10:1.600000 11:1.000000 12:0.000000 13:3.000000";
s1[223]="+1 1:63.000000 2:1.000000 3:4.000000 4:130.000000 5:330.000000 6:1.000000 7:2.000000 8:132.000000 9:1.000000 10:1.800000 11:1.000000 12:3.000000 13:7.000000";
s1[224]="-1 1:35.000000 2:0.000000 3:4.000000 4:138.000000 5:183.000000 6:0.000000 7:0.000000 8:182.000000 9:0.000000 10:1.400000 11:1.000000 12:0.000000 13:3.000000";
s1[225]="-1 1:41.000000 2:1.000000 3:2.000000 4:135.000000 5:203.000000 6:0.000000 7:0.000000 8:132.000000 9:0.000000 10:0.000000 11:2.000000 12:0.000000 13:6.000000";
s1[226]="+1 1:62.000000 2:0.000000 3:3.000000 4:130.000000 5:263.000000 6:0.000000 7:0.000000 8:97.000000 9:0.000000 10:1.200000 11:2.000000 12:1.000000 13:7.000000";
s1[227]="+1 1:43.000000 2:0.000000 3:4.000000 4:132.000000 5:341.000000 6:1.000000 7:2.000000 8:136.000000 9:1.000000 10:3.000000 11:2.000000 12:0.000000 13:7.000000";
s1[228]="-1 1:58.000000 2:0.000000 3:1.000000 4:150.000000 5:283.000000 6:1.000000 7:2.000000 8:162.000000 9:0.000000 10:1.000000 11:1.000000 12:0.000000 13:3.000000";
s1[229]="-1 1:52.000000 2:1.000000 3:1.000000 4:118.000000 5:186.000000 6:0.000000 7:2.000000 8:190.000000 9:0.000000 10:0.000000 11:2.000000 12:0.000000 13:6.000000";
s1[230]="+1 1:61.000000 2:0.000000 3:4.000000 4:145.000000 5:307.000000 6:0.000000 7:2.000000 8:146.000000 9:1.000000 10:1.000000 11:2.000000 12:0.000000 13:7.000000";
s1[231]="+1 1:39.000000 2:1.000000 3:4.000000 4:118.000000 5:219.000000 6:0.000000 7:0.000000 8:140.000000 9:0.000000 10:1.200000 11:2.000000 12:0.000000 13:7.000000";
s1[232]="-1 1:45.000000 2:1.000000 3:4.000000 4:115.000000 5:260.000000 6:0.000000 7:2.000000 8:185.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[233]="+1 1:52.000000 2:1.000000 3:4.000000 4:128.000000 5:255.000000 6:0.000000 7:0.000000 8:161.000000 9:1.000000 10:0.000000 11:1.000000 12:1.000000 13:7.000000";
s1[234]="-1 1:62.000000 2:1.000000 3:3.000000 4:130.000000 5:231.000000 6:0.000000 7:0.000000 8:146.000000 9:0.000000 10:1.800000 11:2.000000 12:3.000000 13:7.000000";
s1[235]="+1 1:62.000000 2:0.000000 3:4.000000 4:160.000000 5:164.000000 6:0.000000 7:2.000000 8:145.000000 9:0.000000 10:6.200000 11:3.000000 12:3.000000 13:7.000000";
s1[236]="-1 1:53.000000 2:0.000000 3:4.000000 4:138.000000 5:234.000000 6:0.000000 7:2.000000 8:160.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[237]="+1 1:43.000000 2:1.000000 3:4.000000 4:120.000000 5:177.000000 6:0.000000 7:2.000000 8:120.000000 9:1.000000 10:2.500000 11:2.000000 12:0.000000 13:7.000000";
s1[238]="-1 1:47.000000 2:1.000000 3:3.000000 4:138.000000 5:257.000000 6:0.000000 7:2.000000 8:156.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[239]="-1 1:52.000000 2:1.000000 3:2.000000 4:120.000000 5:325.000000 6:0.000000 7:0.000000 8:172.000000 9:0.000000 10:0.200000 11:1.000000 12:0.000000 13:3.000000";
s1[240]="+1 1:68.000000 2:1.000000 3:3.000000 4:180.000000 5:274.000000 6:1.000000 7:2.000000 8:150.000000 9:1.000000 10:1.600000 11:2.000000 12:0.000000 13:7.000000";
s1[241]="-1 1:39.000000 2:1.000000 3:3.000000 4:140.000000 5:321.000000 6:0.000000 7:2.000000 8:182.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[242]="-1 1:53.000000 2:0.000000 3:4.000000 4:130.000000 5:264.000000 6:0.000000 7:2.000000 8:143.000000 9:0.000000 10:0.400000 11:2.000000 12:0.000000 13:3.000000";
s1[243]="+1 1:62.000000 2:0.000000 3:4.000000 4:140.000000 5:268.000000 6:0.000000 7:2.000000 8:160.000000 9:0.000000 10:3.600000 11:3.000000 12:2.000000 13:3.000000";
s1[244]="-1 1:51.000000 2:0.000000 3:3.000000 4:140.000000 5:308.000000 6:0.000000 7:2.000000 8:142.000000 9:0.000000 10:1.500000 11:1.000000 12:1.000000 13:3.000000";
s1[245]="+1 1:60.000000 2:1.000000 3:4.000000 4:130.000000 5:253.000000 6:0.000000 7:0.000000 8:144.000000 9:1.000000 10:1.400000 11:1.000000 12:1.000000 13:7.000000";
s1[246]="+1 1:65.000000 2:1.000000 3:4.000000 4:110.000000 5:248.000000 6:0.000000 7:2.000000 8:158.000000 9:0.000000 10:0.600000 11:1.000000 12:2.000000 13:6.000000";
s1[247]="-1 1:65.000000 2:0.000000 3:3.000000 4:155.000000 5:269.000000 6:0.000000 7:0.000000 8:148.000000 9:0.000000 10:0.800000 11:1.000000 12:0.000000 13:3.000000";
s1[248]="+1 1:60.000000 2:1.000000 3:3.000000 4:140.000000 5:185.000000 6:0.000000 7:2.000000 8:155.000000 9:0.000000 10:3.000000 11:2.000000 12:0.000000 13:3.000000";
s1[249]="+1 1:60.000000 2:1.000000 3:4.000000 4:145.000000 5:282.000000 6:0.000000 7:2.000000 8:142.000000 9:1.000000 10:2.800000 11:2.000000 12:2.000000 13:7.000000";
s1[250]="+1 1:54.000000 2:1.000000 3:4.000000 4:120.000000 5:188.000000 6:0.000000 7:0.000000 8:113.000000 9:0.000000 10:1.400000 11:2.000000 12:1.000000 13:7.000000";
s1[251]="-1 1:44.000000 2:1.000000 3:2.000000 4:130.000000 5:219.000000 6:0.000000 7:2.000000 8:188.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[252]="+1 1:44.000000 2:1.000000 3:4.000000 4:112.000000 5:290.000000 6:0.000000 7:2.000000 8:153.000000 9:0.000000 10:0.000000 11:1.000000 12:1.000000 13:3.000000";
s1[253]="-1 1:51.000000 2:1.000000 3:3.000000 4:110.000000 5:175.000000 6:0.000000 7:0.000000 8:123.000000 9:0.000000 10:0.600000 11:1.000000 12:0.000000 13:3.000000";
s1[254]="-1 1:59.000000 2:1.000000 3:3.000000 4:150.000000 5:212.000000 6:1.000000 7:0.000000 8:157.000000 9:0.000000 10:1.600000 11:1.000000 12:0.000000 13:3.000000";
s1[255]="-1 1:71.000000 2:0.000000 3:2.000000 4:160.000000 5:302.000000 6:0.000000 7:0.000000 8:162.000000 9:0.000000 10:0.400000 11:1.000000 12:2.000000 13:3.000000";
s1[256]="-1 1:61.000000 2:1.000000 3:3.000000 4:150.000000 5:243.000000 6:1.000000 7:0.000000 8:137.000000 9:1.000000 10:1.000000 11:2.000000 12:0.000000 13:3.000000";
s1[257]="+1 1:55.000000 2:1.000000 3:4.000000 4:132.000000 5:353.000000 6:0.000000 7:0.000000 8:132.000000 9:1.000000 10:1.200000 11:2.000000 12:1.000000 13:7.000000";
s1[258]="+1 1:64.000000 2:1.000000 3:3.000000 4:140.000000 5:335.000000 6:0.000000 7:0.000000 8:158.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[259]="-1 1:43.000000 2:1.000000 3:4.000000 4:150.000000 5:247.000000 6:0.000000 7:0.000000 8:171.000000 9:0.000000 10:1.500000 11:1.000000 12:0.000000 13:3.000000";
s1[260]="-1 1:58.000000 2:0.000000 3:3.000000 4:120.000000 5:340.000000 6:0.000000 7:0.000000 8:172.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:3.000000";
s1[261]="+1 1:60.000000 2:1.000000 3:4.000000 4:130.000000 5:206.000000 6:0.000000 7:2.000000 8:132.000000 9:1.000000 10:2.400000 11:2.000000 12:2.000000 13:7.000000";
s1[262]="+1 1:58.000000 2:1.000000 3:2.000000 4:120.000000 5:284.000000 6:0.000000 7:2.000000 8:160.000000 9:0.000000 10:1.800000 11:2.000000 12:0.000000 13:3.000000";
s1[263]="-1 1:49.000000 2:1.000000 3:2.000000 4:130.000000 5:266.000000 6:0.000000 7:0.000000 8:171.000000 9:0.000000 10:0.600000 11:1.000000 12:0.000000 13:3.000000";
s1[264]="+1 1:48.000000 2:1.000000 3:2.000000 4:110.000000 5:229.000000 6:0.000000 7:0.000000 8:168.000000 9:0.000000 10:1.000000 11:3.000000 12:0.000000 13:7.000000";
s1[265]="-1 1:52.000000 2:1.000000 3:3.000000 4:172.000000 5:199.000000 6:1.000000 7:0.000000 8:162.000000 9:0.000000 10:0.500000 11:1.000000 12:0.000000 13:7.000000";
s1[266]="-1 1:44.000000 2:1.000000 3:2.000000 4:120.000000 5:263.000000 6:0.000000 7:0.000000 8:173.000000 9:0.000000 10:0.000000 11:1.000000 12:0.000000 13:7.000000";
s1[267]="-1 1:56.000000 2:0.000000 3:2.000000 4:140.000000 5:294.000000 6:0.000000 7:2.000000 8:153.000000 9:0.000000 10:1.300000 11:2.000000 12:0.000000 13:3.000000";
s1[268]="-1 1:57.000000 2:1.000000 3:4.000000 4:140.000000 5:192.000000 6:0.000000 7:0.000000 8:148.000000 9:0.000000 10:0.400000 11:2.000000 12:0.000000 13:6.000000";
s1[269]="+1 1:67.000000 2:1.000000 3:4.000000 4:160.000000 5:286.000000 6:0.000000 7:2.000000 8:108.000000 9:1.000000 10:1.500000 11:2.000000 12:3.000000 13:3.000000";
}
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
int xx;
int file;
//----
//initialize arrays
init_s1();
init_s2();
//initialize training file
file = gFileOpen("c:\heart.txt",WRITE); //open the file for read and write , create it if not exist
string write="";
for(int i=0;i<270;i++)
{
write=s1[i]+"\r\n";
gFileWrite(file,write); //write some date
}
gFileClose(file); //close the file
//initialize test file
file = gFileOpen("c:\heart_test.txt",WRITE);
write="";
for(i=0;i<2;i++)
{
write=s2[i]+"\r\n";
gFileWrite(file,write); //write some date
}
gFileClose(file); //close the file
xx=SvmScale(-1.0,1.0,"c:\heart.txt","c:\heart_scale.txt");
Print("SvmScale: ",xx);
xx=SvmTrain("c:\heart_scale.txt", "c:\heart_scale_model.txt");
Print("SvmTrain: ",xx);
xx=SvmScale(-1.0,1.0,"c:\heart_test.txt","c:\heart_test_scale.txt");
Print("SvmTestScale: ",xx);
xx=SvmPredict("c:\heart_test_scale.txt", "c:\heart_scale_model.txt","c:\heart_predict.txt");
Print("SvmPredict: ",xx);
file = gFileOpen("c:\heart_predict.txt",READ);
string s1=gFileRead(file,3); //
string s2=gFileRead(file,3); //
gFileClose(file); //close the file
int classify1=StrToInteger(s1);
int classify2=StrToInteger(s2);
Comment("c1=",classify1," c2=",classify2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
Comments