Useful features from KimIV - page 79

 
kharko >> :

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

That's how you figure out the bastard... :)))

Except I didn't print it with an alert...


However, this weekend I have to work with Friday, who has frozen server time.

(That's what let me down in the belief that the design will work...)

The way out so far is this:

- I bring the server time to 00:00 and then dance from there.

For example: To know the low of the first (zero???) and the second M15 candlestick of the day.

datetime vremND=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE));
int shift1=iBarShift(Symbol(),15, vremND);
int shift2=iBarShift(Symbol(),15, vremND)-1;
double m151=iLow(Symbol(),15, shift1);
double m152=iLow(Symbol(),15, shift2);
 
KimIV >> :

The DateOfMonday() function.

This function returns the start date of the week (Monday) by its number. For example, if it is now 29.08.2008, the date of the beginning of the current week will be 25.08.2008. The function takes only one parameter - the number of week relative to the current week. For example, 0 is the current week, 1 is the next week and -1 is the previous week. That is, positive week numbers will request dates from the future, while zero and negative numbers will request dates from the past. The return value is the number of seconds elapsed since 00:00 on January 1, 1970.

P.S. Attached is a script to test the DateOfMonday() function.

A simple version of a similar function:

datetime dom=0;
dom=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE))-((DayOfWeek()-1)*86400);
 
kombat писал(а) >>

A simple version of a similar function:

Well, then tell me, what date will Monday have in a fortnight? :-)

 
Roger >> :

Well, then tell me, what's the date for Monday in a fortnight' time? :-)

So... open the calendar, look... oh! found it... it's April 27th, 2009.

:))))))))))))))))))))))))

*

Here, forward or backward will show you the dates of Mondays:

nw week number

0 current week (default)

1 or more backwards in history

-1 or less into the future

datetime WON(int nw=0)
{ 
datetime won;
won=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE))-((DayOfWeek()-1)*86400)-( nw*604800);
return( won);
}
 

I tried to add Kim's SetArrow function to the oscillator to display arrows on the price chart, but for some reason only one arrow is displayed when a signal appears, while I would like to see the history. How is it possible to implement this.


for(i=0; i<limit; i++)
{
if (OscBufferSell[i]<indicator_level2)SetArrow(SYMBOL_ARROWDOWN,Blue, "sell",Time[i],High[i]+3*Point,2);
if (OscBufferBuy[i]>indicator_level1)SetArrow(SYMBOL_ARROWUP,Red, "buy",Time[i],Low[i]-3*Point,2);

}


Help good people! Thank you.

 
zfs писал(а) >>

I tried to add Kim's SetArrow function to the oscillator to display arrows on the price chart, but for some reason only one arrow is displayed when a signal appears, while I would like to see the history. How is it possible to implement this.

for(i=0; i<limit; i++)
{
if (OscBufferSell[i]<indicator_level2)SetArrow(SYMBOL_ARROWDOWN,Blue, "sell",Time[i],High[i]+3*Point,2);
if (OscBufferBuy[i]>indicator_level1)SetArrow(SYMBOL_ARROWUP,Red, "buy",Time[i],Low[i]-3*Point,2);

}

Help good people! Thank you.

Do not forget to give each arrow a unique name

 
Good afternoon - Sunday. Read it all! A lot of useful information! I realised that I need different EAs for the tester and online... Or one with a separate function for working online, a function that will handle errors of opening, modifying and closing orders. Or is that in the plan? I was also hoping to get to an EA template in which I would insert entry, exit, trawl and ... Withdrawal of profit. Another question to Igor: Is there a function that answers the question if a position is closed by Take and a function that answers the question if a position is closed by Stop Loss? Maybe it makes sense to create a function that answers the question if the position is closed by Take, Stop Loss, Trailing Stop or indicator signal. Igor, I'm sure you can do it all. Unless you find it impractical?
 
Just in case: a list of functions with page addresses.
 
The MovingInWL() function just goes through all open positions regardless of input filters sy,op,mn. This also applies to the attached example EA (page 55).
 

Tell me, do you guys have a script like KIMOVSKY ByMarketBuy and ByMarketSell, only schob it would not open positions with a specified lot, but a certain percentage of the deposit. I.e. I specify in the settings parameters like deal size 5% of the deposit, stop 7% (how much of the deposit I'm willing to lose when Stoploss is triggered), profit 15% (how much percent of the deposit I hope to earn) - and the script itself calculates how much is equal to this percent and opens deal equal to this lot, it also calculates the distance in percentage to stop and to profit.

If i would like to know where to find trawl percentage. I.e. I set the distance from price to stop as a percentage of deposit and set the distance in percent of deposit. I have never tried to use this kind of method, but I have never tried to change it.