| 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 |
|
|||
|
How to get EA to remember value of variable from one tick to next?
Hi I'm trying to get an expert adviser to remember the highest ask or bid value as an order goes along with some code like this:
if(Bid>HPriceB && OrderType()==OP_BUY && OrderMagicNumber()==1) { HPriceB=Bid; } But it seems every time it reruns the adviser with each tick , it forgets the value of HPriceB and resets it to zero. What do I do to get it to remember the current value? Do I need to define or declare it in some special way besides just extern double or int? Thanks so much for the help |
|
||||
|
Quote:
Eg. Code:
#property some_property
double HPriceB;
int init(){return(0);}
int deinit(){return(0);}
int start(){return(0);}
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dont remember but | jyrik | Expert Advisors - Metatrader 4 | 0 | 11-03-2006 05:03 AM |
| What's the best way to check if the tick is the first tick of the new bar? | blooms | Metatrader 4 | 2 | 10-31-2006 06:10 AM |
| Problem using Variables Tick-by-Tick | unltdsoul | Metatrader 4 | 2 | 07-04-2006 03:36 AM |