Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Youtube-->https://youtu.be/DNOoRx-htDk
- #include<Trade\Trade.mqh>
- CTrade trade;
- input double beneficio=0.5;
- input double perdida=-0.5;
- void OnTick()
- {
- if(AccountInfoDouble(ACCOUNT_PROFIT)>=beneficio
- ||
- AccountInfoDouble(ACCOUNT_PROFIT)<=perdida)
- {
- while(PositionsTotal()!=0)
- {
- ulong Ticket=PositionGetTicket(0);
- trade.PositionClose(Ticket,-1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment