Let us say you want the trade to expire after 3 hours and 35 minutes
you defin the hours and minutes as at the start of the code
extern int TradeLifeHour=3;
extern int TradeLifeMin=45;
then you define
datetime expirationtime;
then within start() you say
expirationtime = CurTime()+TradeLifeHour*60*60+TradeLifeMin*60;
now use expirationtime in that XXXXXXXXXXXXXXXXXX area.
Hope this helps.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i've had the most difficult time trying to get my Limit/Stop Orders to expire using this code
rderSend(Symbol(),OP_BUYSTOP,Lots,Ask+(9*Point),3,Ask-(SL*Point),Ask+(TakeProfit*Point),"Cross Buy",16384,xxxxxxxx,Lime);
xxxxxx= "Expirydate = Cur time+ expected Lenghth"
i want to know how i can achieve this.
thanks