| New signals service! | |
|
|||||||
| 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 (1) | Thread Tools | Display Modes |
|
|||
|
Quote:
if (CallIndicatorsCheck()) { // your code here } bool CallIndicatorsCheck() { static datetime Oldtime; int Secs = 90; bool Flag; if (CurrTime() >= Oldtime) { Oldtime = CurrTime() + Secs; Flag = true; } return(Flag); } |
|
||||
|
Quote:
Quote:
If you need by death you could could create objects.
__________________
|
|
||||
|
Quote:
![]() |
|
||||
|
The function below will return true while the account history has a loss trade that closed at or after the opening of the 10:th past bar (current bar is 0),
and return false otherwise. PHP Code:
PHP Code:
|
|
|||
|
guys, do you have the same problem?
I have coded an expert. I want to open a position when the price is the same that one indicator. To do this i use the following sentence:
//to buy double indicatorpast = icustom(....................,1); double indicatornow = icustom(....................,0); if (close[1]<indicatorpast && close[0]>indicatornow) OpenBUY(); if (close[1]>indicatorpast && close[0]<indicatornow) OpenSELL(); but with this satatement, the expert opens positions not only when the price cross the indicator, it opens position above the indicator too. I want that the expert open position ONLY when it cross the indicator, so i tried that: //to buy double indicatorpast = icustom(....................,1); double indicatornow = icustom(....................,0); if (close[1]<indicatorpast && close[0]==indicatornow) OpenBUY(); if (close[1]>indicatorpast && close[0]==indicatornow) OpenSELL(); But this statement it is not performing. Do you know what is happen? Because i think there arent errors in the statement. Regards. |
![]() |
| Bookmarks |
| Tags |
| candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
|
||||
| Posted By | For | Type | Date | |
| Need an experienced programmer? - Page 2 | Post #0 | Refback | 09-24-2008 07:24 AM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 05:22 PM |