cucurucu
Assign the current tic value to a HoldVariable and check it with any incoming tic if different then tic is new. { do something } then assign the HoldVariable the new value, and continue.
Must warn you that tic values can bounce to both sides of a MA many times in a short period of time.
The CockeyedCowboy
Quote:
|
Originally Posted by cucurucu
Hi,
Can anyone tell me what is the code (if it exists) for the previous tick price?
I'm trying to write an EA with price crossing SMA but I need to know the previous tick price. I don't need the previous bar's Close. I want the EA to buy when the price is crossing the SMA upwards and to sell when the price is crossing the SMA downwards.
For this I need to compare the actual price and the previous tick price with the SMA. (If the atual price<SMA & the previous tick price > SMA then buy.)
The best solution I've found so far, is to use previous M1 Close but this isn't so accurate as using previous tick price.
Thank you.
|