Expiration - page 3

 

Thanks.

Thanks, cowboy. That answered my question. Unfortunately IBFX doesn't seem to allow time of expiration, only date.

 
bkr1969:
Thanks, cowboy. That answered my question. Unfortunately IBFX doesn't seem to allow time of expiration, only date.

Then the third example would work for you.

You may what to ask IBFX how the time is handled. I mean if they only accept date only then they have to have a time element that they use It may be midnight or the time of carry settlement etc.. what ever it is you need to know from them.

I have also seen brokers giving you options as expiration function on demo and not on live accounts, this is another point to ask them about.

Keit

 

How to expire an application/demo after x days?

Dear Sirs,

I made one dll for one indicator bu VC++ 2008. I want make one change in this code that after for example 7 days expire that.

I mean works it only for 7 days after first start and time that defined on that.

In below you can see one my sample code in C++ and I want add some line in this code for making this limitation time:

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#include

#include

#include

#include

//----

#define MT4_EXPFUNC __declspec(dllexport)

/

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

int Len = 14;

double ld_0;

double ld_8;

double ld_16;

double ld_24;

double ld_32;

double ld_40;

double ld_48;

double ld_56;

double ld_64;

double ld_72;

double ld_80;

double ld_88;

double ld_96;

double ld_104;

double ld_112;

double ld_120;

double ld_128;

double ld_136;

double ld_144;

double ld_152;

double ld_160;

double ld_168;

double ld_176;

double ld_184;

double ld_192;

double ld_200;

double ld_208;

MT4_EXPFUNC double __stdcall Sig(double Ba,int ld_216,double Hi,double Lo,double Clo)

{

for (int li_224 = ld_216; li_224 >= 0; li_224--) {

if (ld_8 == 0.0) {

ld_8 = 1.0;

ld_16 = 0.0;

if (Len - 1 >= 5) ld_0 = Len - 1.0;

else ld_0 = 5.0;

ld_80 = 100.0 * ((Hi + Lo + Clo) / 3.0);

ld_96 = 3.0 / (Len + 2.0);

ld_104 = 1.0 - ld_96;

} else {

if (ld_0 <= ld_8) ld_8 = ld_0 + 1.0;

else ld_8 += 1.0;

ld_88 = ld_80;

ld_80 = 100.0 * ((Hi + Lo + Clo) / 3.0);

ld_32 = ld_80 - ld_88;

ld_112 = ld_104 * ld_112 + ld_96 * ld_32;

ld_120 = ld_96 * ld_112 + ld_104 * ld_120;

ld_40 = 1.5 * ld_112 - ld_120 / 2.0;

ld_128 = ld_104 * ld_128 + ld_96 * ld_40;

ld_208 = ld_96 * ld_128 + ld_104 * ld_208;

ld_48 = 1.5 * ld_128 - ld_208 / 2.0;

ld_136 = ld_104 * ld_136 + ld_96 * ld_48;

ld_152 = ld_96 * ld_136 + ld_104 * ld_152;

ld_56 = 1.5 * ld_136 - ld_152 / 2.0;

ld_160 = ld_104 * ld_160 + ld_96 * fabs(ld_32);

ld_168 = ld_96 * ld_160 + ld_104 * ld_168;

ld_64 = 1.5 * ld_160 - ld_168 / 2.0;

ld_176 = ld_104 * ld_176 + ld_96 * ld_64;

ld_184 = ld_96 * ld_176 + ld_104 * ld_184;

ld_144 = 1.5 * ld_176 - ld_184 / 2.0;

ld_192 = ld_104 * ld_192 + ld_96 * ld_144;

ld_200 = ld_96 * ld_192 + ld_104 * ld_200;

ld_72 = 1.5 * ld_192 - ld_200 / 2.0;

if (ld_0 >= ld_8 && ld_80 != ld_88) ld_16 = 1.0;

if (ld_0 == ld_8 && ld_16 == 0.0) ld_8 = 0.0;

}

if (ld_0 0.0000000001) {

ld_24 = 50.0 * (ld_56 / ld_72 + 1.0);

if (ld_24 > 100.0) ld_24 = 100.0;

if (ld_24 < 0.0) ld_24 = 0.0;

} else ld_24 = 50.0;

return(ld_24);

}

}

Best Regards,

Reza.

Reason: