Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Improved the closing condition of MOB_insertData.mq4 |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | 3fa003f9429f81e7fa347b86828df22fab6eb022 |
User & Date: | onagano 2011-04-20 12:14:59 |
Context
2011-04-22
| ||
04:26 | Changed the type of price from numeric to double check-in: 3b9b6b68f5 user: onagano tags: trunk | |
2011-04-20
| ||
12:14 | Improved the closing condition of MOB_insertData.mq4 check-in: 3fa003f942 user: onagano tags: trunk | |
12:05 | Improved the logic of copyRates check-in: 8b84736cc6 user: onagano tags: trunk | |
Changes
Changes to experts/MOB_insertData.mq4.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 .. 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ... 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
extern string ExtTablePrefix = "MOB_"; int insertTick; int insertBar; datetime lastTickTime; int lastTickFraction; datetime lastBarTime; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { if (!IsDllsAllowed()) { ................................................................................ //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- // Insert the very last bar if the time passed enough. datetime serverTime = Time[0]; // Doesn't proceed on weekends. datetime currentTime = mob_time(); // Native time() API. if ((currentTime - serverTime) >= Period() * 60) { insertBarAt(0); } int rc = mob_close(); if (rc < 0) return (rc); //---- return(0); ................................................................................ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- startTick(); startBar(); //---- return(0); } //+------------------------------------------------------------------+ int prepareTable(string tableName, bool isBar) { int rc; |
> < | | > |
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 .. 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ... 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
extern string ExtTablePrefix = "MOB_"; int insertTick; int insertBar; datetime lastTickTime; int lastTickFraction; datetime lastBarTime; datetime lastGMTime; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { if (!IsDllsAllowed()) { ................................................................................ //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- // Insert the very last bar if the time passed enough. datetime currentGMTime = mob_time(); if ((currentGMTime - lastGMTime) >= Period() * 60) { insertBarAt(0); } int rc = mob_close(); if (rc < 0) return (rc); //---- return(0); ................................................................................ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- startTick(); startBar(); lastGMTime = mob_time(); //---- return(0); } //+------------------------------------------------------------------+ int prepareTable(string tableName, bool isBar) { int rc; |