Useful features from KimIV - page 78

 
granit77 писал(а) >>

As many people as there are opinions. It is comforting to know that mine coincided with komposter's opinion on Prival' s link.

As a suggestion: in your case, if there are two magiks in your EA, you can use the magik generated for the pair and the TF and its negative value.

Good idea.

   if( UpDn)
      Magic_№= GetMagic(StringConcatenate("Expert",Symbol()), TF);
   else
      Magic_№=- GetMagic(StringConcatenate("Expert",Symbol()), TF);
 
Do you have any script that can simulate the opening of positions in the tester? For example, the system of manual trading, I put the required indicators on the chart and run an Expert Advisor - to make the tester work. a signal from indices formed and I send the script on the chart, and it simulates the opening of a deal. and so on for each signal. and then I look whether the strategy is profitable or not.
 
berserker >> :
Do you know if there is any script that can simulate the opening of positions in the tester. For example, the system of manual trading, I put on the chart the necessary indicators and run any advisor - so that the tester worked. so formed signal from indyuki and I throw the script on the chart, and it simulates the opening of a deal. and so on for each signal. and then I look profitable strategy or not.

See Visualization Testing. Manual Trading. and Visual Profitability Testing of Indicators and Signals.

 
berserker >> :
Do you know if there is any script that can simulate the opening of positions in the tester. For example, the system of manual trading, I put on the chart the necessary indicators and run any Expert Advisor - to make the tester work. a signal from indyuki formed and I throw the script on the chart, and it simulates the opening of a deal. and so on for each signal. and then I look profitable strategy or not.
https://forum.mql4.com/ru/20511
 
I want to get the value of the price high from time x(hours minutes) to time y(hours minutes).At the current time I am interested in the value of this range, if it has passed, and if not, the previous one. Doesn't anyone have any developments of this type.
double HourlyHigh(string _smb,int StHour,int StMin,int EndHour,int EndMin)
{
 int _hour,_minute;
 double max;
 max=0;
 _hour=TimeHour(iTime(_smb,1,0)); 
 if (_hour>= EndHour+1)
  for (int i=2880; i>=0; i--)
   if (TimeHour(iTime(_smb,1, i))>= StHour&&TimeHour(iTime(_smb,1, i))<= EndHour&& max<iHigh(_smb,1, i)&&TimeDay(iTime(_smb,1, i))==TimeDay(iTime(_smb,1,0)))
       max=iHigh(_smb,1, i);//&&TimeMinute(iTime(_smb,1,i))>=StMin&&TimeMinute(iTime(_smb,1,i))<=EndMin
 else
    for ( i=2880; i>=0; i--)
   if (TimeHour(iTime(_smb,1, i))>= StHour&&TimeHour(iTime(_smb,1, i))<= EndHour&&TimeDay(iTime(_smb,1, i))==TimeDay(iTime(_smb,1, i-1440)))
       max=iHigh(_smb,1, i);
   return ( max);     
}
double HourlyLow(string _smb,int StHour,int StMin,int EndHour,int EndMin)
{
 int _hour,_minute;
 double min;
 min=9999.0;
 _hour=TimeHour(iTime(_smb,1,0)); 
 if (_hour>= EndHour+1)
  for (int i=2880; i>=0; i--)
   if (TimeHour(iTime(_smb,1, i))>= StHour&&TimeHour(iTime(_smb,1, i))<= EndHour&&TimeDay(iTime(_smb,1, i))==TimeDay(iTime(_smb,1,0)))
       min=iLow(_smb,1, i);
 else
    for ( i=2880; i>=0; i--)
   if (TimeHour(iTime(_smb,1, i))>= StHour&&TimeHour(iTime(_smb,1, i))<= EndHour&& min>iLow(_smb,1, i)&&TimeDay(iTime(_smb,1, i))==TimeDay(iTime(_smb,1, i-1440)))
       min=iLow(_smb,1, i);
  return ( min);
  
}
I tried something, but for some reason I get 0 in the output. And it's looking for both high and low.
 
zfs писал(а) >>
I want to get the value of high price from time x(hours minutes) till time y(hours minutes). Doesn't anyone have any developments of this type. I've tried something, but for some reason I get 0 in the output. And it's looking for both high and low.

Have you tried the iHighest and iLowest functions? All you have to do is translate the required time into indexes and you'll get the result you're looking for...

 
kharko >> :

Have you tried the iHighest and iLowest functions? All you have to do is to convert the required time into indexes and you'll get the result you're looking for...

Thank you. I will try it.

 
granit77 >> :

As many people as there are opinions. It's heart-warming that mine coincided with komposter's opinion on Prival's link.

I have now given up using the chart period in mejic.

Sometimes I want to switch the TF while Expert Advisor is running, but this method of generation will immediately "start another EA".


And instead of Period() I try to use extern TimeFrame, so the EA works equally on any period chart.

 

Once again, a big "Ahem...".

I noticed this (for me) unpleasant thing with the time at the weekend.

StrToTime("01:25")

Assuming that ALL times are computed relative to server time

(or its last known value) (well, except for TimeLocal () of course )

However, this is not true and I have wasted a lot of time trying to figure out

reasons for wrong filtering... :((( You live and learn...


SZY: A built-in function that directly calculates the price at a given time would have been useful.

I'm currently working on it this way:

double shvr=iLow(Symbol(),15,iBarShift(Symbol(),15,StrToTime("01:25")));
 
kombat писал(а) >>

So you don't have to guess. >> Check...

Print(TimeToStr(StrToTime("01:25"), TIME_DATE| TIME_MINUTES));
Reason: