how can i make my ea to take one position when one signal appears

 

yes i am new at mql coding.i want to learn it.

i am writing a kind of simple ea.i want my ea to take just one position when all of conditions are true.i dont want my ea to take more than one position when signal continues.

my conditions are very simple when rsi 50 crosses stokastik crosses and ema crosses i want to take position.if it is possible i want to add alert when signal appears.yes how can i do it??

when my three conditions are true ea should take one position.and after this position ea should wait to go take profit or stop loss and wait an opposite signal..

this is my ea.please help..thank you

Files:
simplenea.mq4  34 kb
 
There are a couple of ways to do this. Easiest example is in the Book where: if ( OrdersTotal() < 1 ) then OrderSend. The method I use now is to search for Active Orders. If your Stoploss and Takeprofits are really short then you may want to put a TimeStamp like: if (TimeStamp != Time[0]) OrderSend...then make TimeStamp = Time[0]. I actually use a combination of those 2 now_a_days. Hope that helps.