Useful features from KimIV - page 61

 
kombat >> :

For example a "calculator" of the number of months back relative to the current month:

but this simplistic approach has its pitfalls,

which will manifest itself in the fact that it is possible to misidentify

at the beginning of subsequent months...

Use ibarshift on a daily period, thus either getting the number of bars (days) or -1 (i.e. hitting Saturday or Sunday),

then shift forward or backward once or twice to get Friday or Monday and get the number of days, then as

you want to add or subtract the shift... and then get the number of months by yourself...


PS. I hope the author of this thread forgives the intrusion...

 
kombat писал(а) >>

I see the end of FuncStPeriod(int Per, int Val) function like this:

I was too hasty with the string... I'm so ashamed of myself... :)))

Well, I solved (sort of...) the task, or rather a part of it, this way:

//+--- Скрипт. дт1.mq4-----------+

int start()
{
datetime T1, T2;
T1=StrToTime("2008.10.25");
T2=StrToTime("2008.10.31");

for(int i=0; i<OrdersHistoryTotal(); i++)
{
if(OrderSelect( i, SELECT_BY_POS, MODE_HISTORY) && OrderSymbol()==Symbol() && OrderType()<=1 && FuncStPeriod())
   {   
   Alert("ch: ", i," nbr: ",TimeToStr(OrderCloseTime(), TIME_DATE| TIME_SECONDS)," s: ",OrderSymbol());
   }
}
   return(0);
}
//+------------------------------------------------------------------+

bool FuncStPeriod()
{
// int Per, int Val
bool fsp;
datetime T1, T2;
T1=StrToTime("2008.10.25");
T2=StrToTime("2008.10.31");
//...
fsp=OrderCloseTime()> T1 && OrderCloseTime()< T2;
return( fsp);
}
 

Brother hearts help a novice trader:)

Decided to play on the news and cashed out - stupid but I ran out of money :(((

WMR R266873268087

The result of collecting on the site Kapilochka . napod . r u

Such misfortunes happen :((((

I WISH YOU GOOD LUCK ANALYTICS

AND LET THE MONEY STICK LIKE A SNOWBALL !

 
Igor, happy birthday!!!!!!!
 
poruchik писал(а) >>
Igor, happy birthday!!!!!!!

>> thank you, Stas!

 

Congratulations!!!

All the best and good health!

 

Galavadabryu (c) Masyanya

 
I join in congratulations. I wish more creative achievements and good health to you and your family.
 

I am a little late, but no less cordial, to join in congratulations!

Unfortunately, the holiday is not eternal and the harsh everyday life reminds us of itself.

Igor, I'm doing something wrong with the connection of b-Positions.mqh library. It is in include and b-Orders.mqh and b-KimIV.mqh are in it. The line #include <b-Positions.mqh> after external variables before init is added to the EA. When compiling the EA, the following message is displayed: 'b-Positions .mqh' - file already processed. After compilation, EA external variables are not available, as if they haven't been registered.

However, the EA works.

 
granit77 писал(а) >>
When compiling the EA I get a message: 'b-Positions.mqh' - file already processed.

This means that the file b-Positions.mqh is attached more than once. Most likely, you attach it in the EA code, and it is also attached in the b-Orders.mqh code.

I've already written somewhere how I use my functions. I do not append these files to my EAs; I just copy the required functions from them to the code of my EAs. It's easier for me...

granit77 wrote >>
>> After compiling, EA external variables are not available, as if they were not written.

The #include file attached by the compiler directive contains such a thing:

#property library

This is the one that disables external parameters. This issue has already been discussed on this forum. What to do? The solutions are two:

1. Remove #property and continue using #include.

2) Leave #property and use #import instead of #include.

Reason: