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