Can we suggest some new features in MQL 4???

 

Hi,

Every body my question is for Metaquotes can we suggest any new features in software. Like for example I wanted to give an additional tag to the orders. For which currently I am using an array to do it. But my technique has flaw tha if a expert advisor is restarted I loose the tag on the order. To explain more clearly what I do is I tag the opned orders with statuses such as 100, 200, 300 and so on and so forth. depending on the status of the opend order I decide to close them or send a counter order if it is going in loss. But due to this limitation that once I restart my EA I will loose track of the status. As the status is tracked by an array in the EA and status is not there in the opened order for my EA to read even after restart of it.


Thanks in Advance

Suhail

 

Suhail,


some early morinig free thinking? ideas:

  1. use Client Terminal Global Variables - see editor help docs. These are persistent across EA start/stop/restart/... Although they are only type double, each has in fact two ways to store two different datums (actually many more if partition up 255byte name string): 1, variable name is a string (which you makeup and a string has 255bytes of storage, yes?), 2, the double value itself
  2. IF your tag is static value, why not use or combine inside the int OrderMagicNumber() is a 32-bit quantity... loads of room to use creatively regards dividing into subfields etc.
  3. use disk file for persistent memory across shutdown/restart, note that since int deinit is called prior to EA closing for good, you could dump/update disk file with order data
  4. use disk file as immediate sink on every order transaction - since order magic# should imho be unique for each new orderSend, it could be used as write/read key (say, first datum in record written to disk) The file functions give great freedom as to ways to do file i/o
  5. combining some of above... a global variable could hold value from int FileTell() just prior to writing data record. This filePointer datum could be incorporated into a Global Variable as mentioned above. Why? use datum in bool FileSeek() to return to/remap the record so can then read it...

in summary, have mentioned three ideas which can be combined to produce further options: Global Variables, OrderMagicNumber, disk files

all three are free from temporary nature of EA and would appear to be have the data persistentcy attribute you desire.


would need more input regards design to be more concrete in suggestions, but perhaps ideas above will get you playing about to come up with scheme to suit, yes?


the primitives are all built in to Terminal - is just need to do the old lateral thinking process imho!


have fun

;o)

 
sarc007:

Hi,

Every body my question is for Metaquotes can we suggest any new features in software. Like for example I wanted to give an additional tag to the orders. For which currently I am using an array to do it. But my technique has flaw tha if a expert advisor is restarted I loose the tag on the order. To explain more clearly what I do is I tag the opned orders with statuses such as 100, 200, 300 and so on and so forth. depending on the status of the opend order I decide to close them or send a counter order if it is going in loss. But due to this limitation that once I restart my EA I will loose track of the status. As the status is tracked by an array in the EA and status is not there in the opened order for my EA to read even after restart of it.


Thanks in Advance

Suhail

EA pause button for each currency pair so that when you want to stop EA for one symbol, the EA can still work with other symbols.

 
ukt:

Suhail,


some early morinig free thinking? ideas:

  1. use Client Terminal Global Variables - see editor help docs. These are persistent across EA start/stop/restart/... Although they are only type double, each has in fact two ways to store two different datums (actually many more if partition up 255byte name string): 1, variable name is a string (which you makeup and a string has 255bytes of storage, yes?), 2, the double value itself
  2. IF your tag is static value, why not use or combine inside the int OrderMagicNumber() is a 32-bit quantity... loads of room to use creatively regards dividing into subfields etc.
  3. use disk file for persistent memory across shutdown/restart, note that since int deinit is called prior to EA closing for good, you could dump/update disk file with order data
  4. use disk file as immediate sink on every order transaction - since order magic# should imho be unique for each new orderSend, it could be used as write/read key (say, first datum in record written to disk) The file functions give great freedom as to ways to do file i/o
  5. combining some of above... a global variable could hold value from int FileTell() just prior to writing data record. This filePointer datum could be incorporated into a Global Variable as mentioned above. Why? use datum in bool FileSeek() to return to/remap the record so can then read it...

in summary, have mentioned three ideas which can be combined to produce further options: Global Variables, OrderMagicNumber, disk files

all three are free from temporary nature of EA and would appear to be have the data persistentcy attribute you desire.


would need more input regards design to be more concrete in suggestions, but perhaps ideas above will get you playing about to come up with scheme to suit, yes?


the primitives are all built in to Terminal - is just need to do the old lateral thinking process imho!


have fun

;o)

Thanks for your reply. I think I would go for Global Variables or Disk Files or Magic Number as suggested. But why I wanted (a status to be stored in the order ) was I have too much of Electricity (Power ) problems will deinit() work if the power is lost all of a sudden. Though I am using UPS but when automatic shutdown takes place all information is lost. Secondly can I change the magic number for example of an order. Because what I want to do is chnage the status of the order if it reaches orderprice() + x points and then change it again if it reaches orderprice() +2x points and so on.

Again Thanks in Advance for enlightment

Suhail

 

Suhail, that's a tough deal you have (I take power=ON for granted - IF i pay my bills on time :) yet, for sure is not a global happening...:(

Glad you have UPS - questions for you: is UPS of type online or offline?

My understanding is that most less expensive UPS's are offline and rely on power IN monitoring + fast switching circuits, yet no matter how fast switch over to battery, glitch seen on line IN to computer - some not mind, some do! Whereas, online supply line IN to computer via battery + associated circuits and just use it's power IN to feed battery charging etc. - meaning can turn mains supply off and not make shred bit of difference to power IN to computer...

... sorry bout that I ramble! but reason really was that I seem to remember that within PC, software can be 'aware' that line has gone down - ummm, via UPS driver I think.

Just saying, as shame "Though I am using UPS but when automatic shutdown takes place all information is lost." So then, IF PC knows about linedown condition, must be open source or? out there to cause OS to shut-down gracefully... yes?


Disk files...

Why? personally I would not trust that Terminal had flushed to disk with latest state (to include Global Variables one would hope :)


magic number - is set in concrete at OrderSend() time.


Well again, the status change has to be reflected as already suggested via gVars,disk,magic - but reading more what you say, I guess actually magicNumber is not good because contents of it are only 'settable' prior sending original order. Thereafter is readOnly...


for sure, gVars are the easiest? not think much about this - simply put, I sweated ages getting something I can live with regards gVars and diskFiles and... then just shoved them/functions away into .mqh file and in the main... have forgot about them as it were.


Are many forum articles on log files (read any file really...) and terminal gVars..


enlightment???

c'mon dude! - just ramblings of a past hacker gone mostly brain dead now...LOL


Sending you power at all levels ;)


ps:

just had to key below in... is some of the Not included in final cut of book verbage of Hal Spacejock...

It hit me that 'computing' can be associated with these insights too! (even your need to ensure the remembering of data Apres moi le wreckage... ;o)


Apres moi le wreckage...


Your only as good as your last backup.


Look before you blunder.


A stitch in time saves uncontrollable blood loss.

Reason: