How to know the highest point of a trade?

 

Hi everybody

when I open trade I'd like to see to highest point of my trade, but my program doesn't work .

For exemple, if my trade is LONG :

double open = iOpen(NULL, 0, Current + 0);

double close = iClose(NULL, 0, Current + 0);

double openp1 = iOpen(NULL, 0, Current + 1);

double closep1 = iClose(NULL, 0, Current + 1);

if (OrderType()==OP_BUY && close > closep1)

double hightest_point = close;

Alert ("the new hightest point is ", hightest_point); // The alert return me "0"

if (OrderType()==OP_BUY && close < closep1)

/*

here I 'd like to determinate

the hightest point since I open the trade, and put an Alert like this :

ALert ("TAKE CARE the trade is SHORT now! the highest point is unchange ", --variable of the highest point--);

*/

How can I do??

Thanks in advance

 

Hi everyboy

I solve a part of my problem with that :

iHighest - MQL4 Documentation

and I do that :

double top_High = High[ Highest( NULL, 0, MODE_HIGH, 10, 1 ) ];

double top_Sell = Low [ Lowest ( NULL, 0 ,MODE_LOW , 10, 1 ) ];

Alert(Symbol(), " " , Period(), " topH = " , top_High, " topS = " , top_Sell);

Now, How can I do to fine the Highest and Lowest since a trade begin?

For example :

If the trade begin at 6 h 00

and if it's 8 h oo : top_High = High[ Highest( NULL, 0, MODE_HIGH, 2, 1 ) ];

if it's 10 h oo : top_High = High[ Highest( NULL, 0, MODE_HIGH, 4, 1 ) ];

if it's 12 h oo : top_High = High[ Highest( NULL, 0, MODE_HIGH, 6, 1 ) ]; etc..

Help please!

Best regards

 

use int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)

Thanks to DxdCn from Highest and Lowest since a trade begin - MQL4 forum