strategy tester doesn't work properly

 

hello every one. I am newbie in mql4.  i

I have  written a code. But it doesnt work properly in strategy tester

I want to set a  sell stop at a certain time and after thar delete the pending order. my code is :

extern double lot_1=0.4;

extern int fasel_pending_1=100;

extern int slipage=10;

extern int hour_be_soorat_24=13;

extern int minute=30;


if (Hour()==hour_be_soorat_24 && Minute()== minute && OrdersTotal()==0 ) 

 OrderSend(Symbol(), OP_SELLSTOP,lot_1,Ask-100*Point,slipage,0,0);

OrderSelect(0,SELECT_BY_POS,MODE_TRADES);  

int shomare=OrderTicket();  

OrderDelete(shomare);

   would you please help me

thanks alot

 
sara64ab: I have  written a code. But it doesnt work properly in strategy tester.
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it

  2. "Doesn't work" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
  3. What you showed won't even compile. Post your real code that does.
  4. Check your return codes What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
 

Please use the SRC button when posting code. I have done it for you this time.

What is your code doing?

What do you expect it to do?

Where in your code is the 2nd block?

Why are you calculating the distance from Ask for a SellStop?

You appear to be opening a SellStop order and then immediately closing it - why?

Reason: