how can i find the price of previous MA crossover (buy or sell) signal

 

hlw coders

i m in little trouble in coding of EA, i made it according to MA crossover signal

if signal buy its cancel previous sell signal and placed new buy order

also same for sell signal..

i already made it.... but i m in trouble to find what was previous signal and at what price from the latest signal casue if the both signal very near in minimum 25 pips the latest signal not placed open order.

so i need previous buy or sell crossover signal in what price the cross...can anybody help me plz



 
sajib0189:

hlw coders

i m in little trouble in coding of EA, i made it according to MA crossover signal

if signal buy its cancel previous sell signal and placed new buy order

also same for sell signal..

i already made it.... but i m in trouble to find what was previous signal and at what price from the latest signal casue if the both signal very near in minimum 25 pips the latest signal not placed open order.

so i need previous buy or sell crossover signal in what price the cross...can anybody help me plz




Use:

 

iMA()
 
DeanDeV:

Use:

 

 

i already used iMA() and getting result, but my problem is how can i get, what was previous crossover either buy or sell?


in my screenshot latest crossover is buy and no problem for that, how i get the previous sell cross over price by code for my EA?

 
sajib0189:

i already used iMA() and getting result, but my problem is how can i get, what was previous crossover either buy or sell?


in my screenshot latest crossover is buy and no problem for that, how i get the previous sell cross over price by code for my EA?


I'm no expert, however, I would save the price at each long/short crossover and then reset those prices when a new long/short crossover happens.
 
DeanDeV:
I'm no expert, however, I would save the price at each long/short crossover and then reset those prices when a new long/short crossover happens.

that also helpful, if i can save the crossover price

what is the code for saving crossover price?

is it save in csv or excel?  better if i get the code for save in crossover price & time, and read it later


thanks

 
sajib0189: what is the code for saving crossover price?
RFTM Static Variables - MQL4 Documentation
Reason: