I made this EA to buy order when isar is below Ask and sell when isar is over the Bid,it compiles without problem,but it doesnt closes any position,since i want only one order this is a problem.
Also when i debug and put a breakpoint inside the OniTick it simply jumps over that breakpoint and the arrow that shows where it stopped dissapears.
Also when i am testing this ea in the journal nothing is printed,only the first and last print commands.
Also i have tried any known to me method to selectt the open order and close it be it variables in the function,be it orderstotal()-1 nothing worked .
Also i think my metaeditor is broken,but lets fix the above.
Any help is welcome.
I made an edit and cut out the most important part,
Your MetaEditor is not broken. There are just some issues with the code. I will mention some of them:
/* I have not tested, but I think this would only work in strategy tester. The first parameter of OrderSelect() here should be a ticket number as displayed on your terminal. If there are no orders in the market, this EA would try to select an order with a ticket number of 0! */ if(OrderSelect(OrdersTotal(),SELECT_BY_POS,MODE_TRADES)==true) /* You should check the type of the order before closing it, or at least use OrderClosePrice() since in your code, the order is already selected before closing. */ if(OrderClose(OrderTicket(),0.01,Bid,3,Red)==true)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I made this EA to buy order when isar is below Ask and sell when isar is over the Bid,it compiles without problem,but it doesnt closes any position,since i want only one order this is a problem.
Also when i debug and put a breakpoint inside the OniTick it simply jumps over that breakpoint and the arrow that shows where it stopped dissapears.
Also when i am testing this ea in the journal nothing is printed,only the first and last print commands.
Also i have tried any known to me method to selectt the open order and close it be it variables in the function,be it orderstotal()-1 nothing worked .
Also i think my metaeditor is broken,but lets fix the above.
Any help is welcome.
I made an edit and cut out the most important part,