[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 600

 
sasha1995:

It's not working ( T/P is still not outputting

Are you all conspiring?! "Still no T/P" - care to decipher! Do it:

Print ("max = ", max, " | min = ", min);

And show what's in the log.

And don't forget that there are RULES that the DC defines by the distance of TP and SL from the current price - these rules need to be OBEYED!!!!

 
sasha1995:

Not working ( still no T/P output

Is napravl < 0 -- is it 'straight south'?
 
TarasBY:

Are you all in cahoots?! "Still no T/P" - care to decipher! Do it:

And show what's in the log.

And do not forget that there are RULES that determine the distance of TP and SL from the current price - these rules should be OBEYED!



2012.12.08 20:23:18 2012.12.07 00:00 sasha EURUSD.m,M15: max = 1.3079 | min = 1.295

 
dbs039:

Good afternoon all, I am interested in such a question, how can I work with ticks, starting from some event, for example, compare the value of the first tick after some event and the n-th, as I understand during the function start the price, for example, Bid all the time is overwritten, plus I can operate with the previous value, but how to operate with the pre-prime and so on, where and how it all written? Thank you for your attention)

To an array:

double gda_Array[1000000][3];
int    gi_cnt = 0;
void start()
{
    gda_Array[gi_cnt][0] = GetTickCount();
    gda_Array[gi_cnt][1] = TimeCurrent();
    gda_Array[gi_cnt][2] = Bid;
    gi_cnt++;
    if (gi_cnt > ArrayRange (gda_Array, 0)) ArrayResize (gda_Array, gi_cnt);
}

And play with the ticks. You can write them to a file.

 
sasha1995:

2012.12.08 20:23:18 2012.12.07 00:00 sasha EURUSD.m,M15: max = 1.3079 | min = 1.295

This suggests that the high and the low have been calculated.
 
dbs039:

Good afternoon all, I am interested in such a question, how can I work with ticks, starting from some event, for example, compare the value of the first tick after some event and the n-th, as I understand during the function start the price, for example, Bid all the time is overwritten, plus I can operate with the previous value, but how to operate with the pre-existing and so on, where and how it all written? Thank you for your attention)


There is no option in the standard delivery of MT4 to work with tick history. If you do want it, readhttp://www.opentraders.ru/downloads/17/http://avtoforex.ru/testirovanie/5-kachestvo-modelirovanija-99-procentov-v-testere-strategij.html
 
if(OrderTakeProfit()!=0&&OrderTakeProfit()!=OrderOpenPrice()+2*kio*Point&&Bid>OrderOpenPrice()+50*kio*Point)
               OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()+2*kio*Point,0);
Hi all. Can you tell me what's wrong with Error #1 how to fix it? thank you!
 
laveosa:
what's wrong with Error 1? Thank you!


You are trying to put a takeprofit on a two-step order when the price is 50 steps higher than the same level in the same direction. In this case it will no longer be a take profit, but a stop loss. Takeprofit for a Buy order is everything that is higher than the current Ask price, not the price at which the order was placed. For a Sell order it is the other way around.

And normalize the prices.

 
r772ra:

I think it's all about the GetPriceToInput() function.

Right. Basically, the limit price is calculated there. And as it turned out, we needed a condition thatGetPriceToInput() should be lower than Ask for bays and higher than Bid for sels, respectively. This check was missing, that's why error 130 appeared sometimes.
 
r772ra:

Try taking indicator values from bar 1 and bar 2. Something like this.

I need just 1 and 0, but that's not the problem here: the orders (circled in red), why do they open??? there's no trigger criteria for them on the chart ((.
Reason: