| 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 | Thread Tools | Display Modes |
|
||||
|
Try This
heres how i would approach the problem:
double cci = iCCI(.....); double ccistop, lastccistop; if(OrderType()=OP_BUY){ ccistop = cci - 20; if(ccistop > lastccistop) { lastccistop = ccistop; } if(lastccistop>=cci) { OrderClose(.....); } } if(OrderType()=OP_SELL){ ........... etc. } I dont know if thats correct I just thought of that right know. hope that helps, Mikhail Quote:
|
|
||||
|
Thanks,
But It only works once. I need to reset it after the function is completed. How would you do that? Quote:
|
|
||||
|
Quote:
like: if (orderstotal()<1) { lastccistop = 0; } there that should do it... I suggest you make those variable global vars. Kind regards, Mikhail |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trailing Stop EA | newdigital | Expert Advisors - Metatrader 4 | 48 | 11-14-2008 06:31 AM |
| How to set a trailing stop??? | theolive9 | Metatrader 4 | 1 | 12-06-2006 12:12 AM |
| EA trailing stop | JoZo | Metatrader 4 | 6 | 11-10-2006 02:34 PM |