File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
examples_of_expert_advisor Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
"""Expert Advisor examples for MetaTrader 5.
2
2
3
3
This package contains example implementations of various trading strategies.
4
- """
4
+ """
Original file line number Diff line number Diff line change 82
82
trade .stop_loss = zone_382
83
83
trade .take_profit = zone_618
84
84
85
- if len (Mt5 .positions_get (symbol = trade .symbol )) == 1 :
86
- if (
85
+ if len (Mt5 .positions_get (symbol = trade .symbol )) == 1 and (
86
+ (
87
87
Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 0
88
88
and tick .last > Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open + zone_236
89
- ) or (
89
+ )
90
+ or (
90
91
Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 1
91
92
and tick .last < Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open - zone_236
92
- ): # if Buy
93
- trade .stop_loss = trade .sl_tp_steps
93
+ )
94
+ ):
95
+ trade .stop_loss = trade .sl_tp_steps
94
96
95
97
trade .emergency_stop_loss = trade .stop_loss
96
98
trade .emergency_take_profit = trade .take_profit
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
1
2
"""Generate the API reference pages for the MQPy package."""
2
3
3
4
import sys
You can’t perform that action at this time.
0 commit comments