File tree Expand file tree Collapse file tree 3 files changed +17
-18
lines changed
examples_of_expert_advisor/fimathe Expand file tree Collapse file tree 3 files changed +17
-18
lines changed Original file line number Diff line number Diff line change 1- """EURUSD FiMathe Expert Advisor for MetaTrader 5.
1+ """
2+ EURUSD FiMathe Expert Advisor for MetaTrader 5.
23
34This Expert Advisor uses Fibonacci retracement levels to determine entry and exit points.
45"""
5-
66import MetaTrader5 as Mt5
77import numpy as np
88from include .rates import Rates
7272 trade .stop_loss = zone_236
7373 trade .take_profit = zone_618
7474
75- if len (Mt5 .positions_get (symbol = trade .symbol )) == 1 :
76- if (
77- Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 0
78- and tick .last > Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open + zone_236
75+ if len (Mt5 .positions_get (symbol = trade .symbol )) == 1 and (
76+ (
77+ Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 0 and
78+ tick .last > Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open + zone_236
7979 ) or (
80- Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 1
81- and tick .last < Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open - zone_236
82- ): # if Buy
83- trade .stop_loss = trade .sl_tp_steps
80+ Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 1 and
81+ tick .last < Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open - zone_236
82+ )
83+ ):
84+ trade .stop_loss = trade .sl_tp_steps
8485
8586 trade .emergency_stop_loss = trade .stop_loss + zone_236
8687 trade .emergency_take_profit = trade .take_profit + zone_236
Original file line number Diff line number Diff line change 11"""WIN FiMathe Expert Advisor for MetaTrader 5.
22
3- This Expert Advisor is designed for WING21 futures, using Fibonacci retracement levels to
3+ This Expert Advisor is designed for WING21 futures, using Fibonacci retracement levels to
44determine entry and exit points.
55"""
6-
76import MetaTrader5 as Mt5
87import numpy as np
98from include .rates import Rates
8483
8584 if len (Mt5 .positions_get (symbol = trade .symbol )) == 1 and (
8685 (
87- Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 0
88- and tick .last > Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open + zone_236
89- )
90- or (
91- Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 1
92- and tick .last < Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open - zone_236
86+ Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 0 and
87+ tick .last > Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open + zone_236
88+ ) or (
89+ Mt5 .positions_get (symbol = trade .symbol )[0 ].type == 1 and
90+ tick .last < Mt5 .positions_get (symbol = trade .symbol )[0 ].price_open - zone_236
9391 )
9492 ):
9593 trade .stop_loss = trade .sl_tp_steps
You can’t perform that action at this time.
0 commit comments