|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
|
|
LinkBack | Thread Tools |
|
|
|||
|
|||
|
Thank you Mohammed for your helping,
You gave me an idea . We can use this code : double Lo=Low [Lowest (NULL,0,MODE_LOW,( CurTime( )-OrderOpenTime( ))/(60*Period( )),0)]; double Hi=High [Highest (NULL,0,MODE_HIGH,(CurTime( )-OrderOpenTime( ))/(60*Period( )),0)]; What do you think ? Bye. |
|
|
||||
|
||||
|
Quote:
It seems logical! ![]() But I'm not sure CurTime( )-OrderOpenTime( ) will return an integer. The second thing, if the above code is right it must be like that: double Lo=Low [Lowest (NULL,0,MODE_LOW,The_Period_You_Want,( CurTime( )-OrderOpenTime( ))/(60*Period( )))]; double Hi=High [Highest (NULL,0,MODE_HIGH,The_Period_You_Want,(CurTime( )-OrderOpenTime( ))/(60*Period( )))]; Well, we have to test the above code!
__________________
There is a fine line between freedom of expression and hate literature. |
|
|
|||
|
|||
|
Thank you Mohammed For your help.
But I'm sorry, the code didnt work for me, because I don't want to define a certain period which I want the highest or lowest value for it. The code I wrote before worked for me, but I don't know maybe I'm wrong. Thank you again , you are very kind. Ammar |
|
|
||||
|
||||
|
Quote:
I'm happy it worked .
__________________
There is a fine line between freedom of expression and hate literature. |
|
|
|||
|
|||
|
Ammar, you could also use iBarShift() function :
int iBarShift( string symbol, int timeframe, datetime time, bool exact=false) Search for bar by open time. The function returns bar shift with the open time specified. If the bar having the specified open time is absent the function will return, depending on the exact parameter, -1 or the nearest bar shift. Parameters: symbol - Symbol the data of which should be used to calculate indicator. NULL means the current symbol. timeframe - Time frame. It can be any of Time frame enumeration values. time - value to find (bar's open time). exact - Return mode when bar not found. false - iBarShift returns nearest. true - iBarShift returns -1. Sample: datetime some_time=D'2004.03.21 12:00'; int shift=iBarShift("EUROUSD",PERIOD_M1,some_time); Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift); |
| Thread Tools | |
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Highest high for an indicator | derekc | Indicators - Metatrader 4 | 17 | 05-24-2008 11:18 AM |
| Broker with indexes & lowest spread | pete7 | General Discussion | 9 | 09-23-2006 10:18 PM |
| Low[Lowest(...)]; | fxid10t | Metatrader 4 | 3 | 01-21-2006 10:08 PM |