Opto123
Opto123 is an expert advisor based on 123 pattern.
Trading system basic rules:
Long signal:
Point 1: The low in a down trending currency market.
Point 2: An upward correction in the downtrend, the highest bar in the correction before the price falls back up point 3.
Point 3: The low in the move down from point 2 but a failure to make a new lower low than point 1.
Go long at the breakout above point 2 level.
Short signal:
Point 1: The high in an up trending currency market.
Point 2: A downward correction in the uptrend, the lowest bar in the correction before the price moves back up to point 3.
Point 3: The high in the move up from point 2 but a failure to make a new higher high than point 1.
Go short at the breakout below point 2 level.
Exits:
When a trendline of point 1 and point 3 is broken by a closed candle.
Entry and exit conditions
ZigZagType: InternalZigZag means ZigZag points are calculated by the EA, DefaultZigZag means default Metatrader ZigZag is used, MABasedZigZag means MABasedZigZag is used, MMLC means MMLCv12 ZigZag is used. In case of InternalZigZag MinSwingBars, MaxSwingBars options define the minimum and maximum allowed bars between neighbouring points.
ClosedCandle: True means a candle should close beyond point 2 level, false means bid should reach that level.
Buffer: Distance between breakout level and point 2 level.
BufferType: Type of buffer. Pips means a value in pips, ATRMultiplier means an ATR based value and StopLoss is calculated as a multiplier of ATR, Distance12 means buffer value is a multiplier of the distance between point 1 and point 2, Distance23 means buffer value is a multiplier of the distance between point 2 and point 3. The same types apply to all similar settings as well.
Min12Distance: Minimum distance between points 1 and 2. 0 means this option is ignored.
Min12DistanceType: Type of Min12Distance.
Max12Distance: Maximum distance between points 1 and 2. 0 means this option is ignored.
Max12DistanceType: Type of Max12Distance.
Min23Distance: Minimum distance between points 2 and 3. 0 means this option is ignored.
Min23DistanceType: Type of Min23Distance.
Max23Distance: Maximum distance between points 2 and 3. 0 means this option is ignored.
Max23DistanceType: Type of Max23Distance.
Trendline: A trendline connects point 1 and point 3. Ignore means this trendline is not taken into account, Entry means no candle has closed at the opposte side of the trendline for a valid entry, Exit means the whole lots are closed when a candle has closed at the opposte side of the trendline, EntryAndExit means Entry and Exit options are both applied.
ExitOnOppositeSignal: The entire trade or any remaining partial lots are closed when an opposite entry signal, defined by the entry settings, occurs.
ReverseSignals: A long signal opens a short trade, closes a long trade and vice versa.
Trade settings
MagicNumber: Magic number of the trade. If more than one chart of the same pair is opened the magic numbers should be different. Different pairs can have the same magic number.
TradeComment: Comment of the trade as shown at the Metatrader terminal.
TradesPerDirection: Maximum allowed number of simultaneously open trades of the same direction. It can be up to 99.
TradesPerSession: Maximum number of trades that can be opened during each trading session. It includes open and closed trades. If there are no trading sessions, it refers to the whole day. 0 disables this option.
OpenTradesPerPattern: Maximum number of open trades per pattern. 0 means unlimited trades.
TotalTradesPerPattern: Maximum of the total number of open and closed trades per pattern. 0 means unlimited trades.
SwingSL: False means the stop loss value is relative to entry price. True means the stop loss is relative to the nearest swing plus spread for shorts. Value of StopLoss option is added as well. All stop loss and take profit settings are hidden from the broker.
PointSL: The stop loss is relative to point 1, 2 or 3 levels plus spread for shorts. Set it to a number from 1 to 3. Value of StopLoss option is added as well. 0 disables this option.
MinimumSLPips: If SwingSL or PointSL is selected, stop loss value should be at least the defined pips. SwingSL is valid only if MinimumSLPips is greater than zero.
MaximumSLPips: If stop loss is greater than the defined pips, it is reduced to MaximumSLPips. 0 disables this option.
StopLoss: Value of stop loss.
StopLossType: Type of stop loss. Pips means a value in pips, ATRMultiplier means an ATR based value and StopLoss is calculated as a multiplier of ATR. The same types apply to the following settings as well.
VisibleSL: Stop loss visible to brokers used in case of disconnection. It is a multiplier of hidden stop loss value.
We can have up or four take profit levels and each of them can have a different type.
TakeProfit1: Value of the first take profit.
TakeProfit1Type: Type of the first take profit.
TakeProfit2: Value of the second take profit.
TakeProfit2Type: Type of the second take profit.
TakeProfit3: Value of the third take profit.
TakeProfit3Type: Type of the third take profit.
TakeProfit4: Value of the fourth take profit.
TakeProfit4Type: Type of the fourth take profit.
VisibleTP: Take profit visible to brokers used in case of disconnection. It is a multiplier of hidden take profit value.
BreakEvenTrigger: The stop loss moves to the entry price after price is in profit for the defined value.
BreakEvenTriggerType: Type of break even trigger.
LockProfit: The stop loss moves to the entry price plus the defined value after price reaches BreakEvenTrigger level.
LockProfitType: Type of LockProfit.
TrailingStart: Trailing stop is activated when price goes above the entry price for longs or below the entry price for shorts, for the defined value.
TrailingStartType: Type of TrailingStart.
TrailingStop: Value of trailing stop loss. Stop loss is continuously modified so that its distance from current price is always the defined value. 0 disables this option.
TrailingStopType: Type of trailing stop loss.
TrailingStep: The trailing stop loss is modified when price exceeds the level at which the previous trailing stop modification occurred, for the defined value.
TrailingStepType: Type of TrailingStep.
CloseProfitableAfterMinutes: At the defined minutes after its opening, a profitable trade is closed.
CloseLosingAfterMinutes: At the defined minutes after its opening, an unprofitable trade is closed.
Slippage: Maximum allowed slippage of trades.
MaxSpread: No trades are opened when spread is greater than the defined pips. 0 disables this option.
CloseOnProfit: True means that if an opposite or exit signal occurs, only profitable or breakeven trades are closed.
Hedge: True means that a long and short trade can be simultaneously open.
MinTradesDistance: Each trade should be opened in a distance from the most recent open trade. This distance should be at least the defined value. 0 disables this option.
MinTradesDistanceType: Type of MinTradesDistance.
AdditionalTrades: ProfitSide means each new trade should be opened lower for shorts or higher for longs, LossSide means each new trade should be opened higher for shorts or lower for longs, from the most recent open trade of the same direction. AnySide disables this option.
CandlesDistance: Minimum number of candles between open trades of the same direction. 0 means we can open multiple trades during a candle.
SendEmail: Disabled means no email, TradeOpening means an email is sent only when a trade is opened, TradeClosing means an email is sent only when a trade is closed, TradeOpeningOrClosing means an email is sent in both cases.
SendNotifications: Disabled means no push notification, TradeOpening means a notification is sent only when a trade is opened, TradeClosing means a notification is sent only when a trade is closed, TradeOpeningOrClosing means a notification is sent in both cases.
Alerts: Disabled means no alerts, TradeOpening means alerts only when a trade is opened, TradeClosing means alerts only when a trade is closed, TradeOpeningOrClosing means alerts in both cases.
AlertSound: Play the defined sound file with an alert. The sound file should be placed in the sounds directory of Metatrader. Set it to blank for no sound.
ScreenShots: Screenshots are saved in the files folder at the opening and closing of a trade. Disabled means no screenshots, TradeOpening means a screen shot is saved only when a trade is opened, TradeClosing means a screen shot is saved only when a trade is closed, TradeOpeningOrClosing means a screen shot is saved in both cases.
LongColour: Arrow colour of long trades.
ShortColour: Arrow colour of short trades.
LabelFontColour: Colour of the labels that show information of the expert advisor.
Trading hours settings
All hour based settings are in hhmmhhmm format and refer to GMT. The first four digits define the start time and the last four digits the end time. Up to three trading sessions can be used. Set it to “00002400” to trade all day.
AutoGMTOffset: Difference between server time and GMT, defined automatically by the EA. It can’t be used during backtests.
ManualGMTOffset: Difference between server time and GMT, defined manually.
DSTOffset: If ManualGMTOffset is used, Daylight Saving Time correction is automatically applied according to the European Union rules.
TradingSession1: Trading hours restrictions for the first trading session.
TradingSession2: Trading hours restrictions for the second trading session.
TradingSession3: Trading hours restrictions for the third trading session.
MondayOpenHour: For each week, new trades are only opened after this hour of Monday. It is in hhmm format. Set it to blank to disable this option.
FridayCloseHour: Hour of Friday when all trades are closed and no new ones are opened to avoid the weekend gap. It is in hhmm format. Set it to blank to disable this option.
FridayCloseTrades: At FridayCloseHour open trades are closed. None means no trades are closed, ProfitableTrades means only profitable trades are closed, LosingTrades means only losing trades are closed, AllTrades means all trades are closed.
TradingDays: Comma separated days of the week that allow trading.
NewsFilter: No new trades are opened during news period.
MinutesBeforeNews: The NewsFilter is active for the defined number of minutes before news.
MinutesAfterNews: The NewsFilter is active for the defined number of minutes after news.
Money management settings
Lots: The lot size if money management is not used.
Partial exits can occur in up to four stages.
PartialClose1: Percent of the initial lots that is closed when the first exit occurs.
PartialClose2: Percent of the initial lots that is closed when the second exit occurs.
PartialClose3: Percent of the initial lots that is closed when the third exit occurs. If there are any remaining lots, they are closed by the fourth exit.
MoneyManagement: True means that the lot size is defined by the money management.
EquityPercent: Lot size is a percent of account equity. 0 disables this option.
StopLossRisk: Percent of account balance to risk for each trade, if it hits stop loss. 0 disables this option. Only one of EquityPercent or StopLossRisk can be used.
Martingale: Percentage means a LotMultiplier percentage is added to the lot size after a loss, Multiplication means the lot size is multiplied by LotMultiplier after a loss. Martingale is activated only after the initial lots of a trade are closed at loss because of stop loss.
StartMartingaleAfterSL: The martingale sequence starts after the defined number of consecutive unprofitable closed trades.
LotMultiplier: Lot size increase factor in case of Martingale.
MaxMartingaleSequence: The maximum number of consecutive martingaled trades.
CloseAllProfit: All open trades are closed when their total profit reaches the defined percent of account balance. 0 disables this option.
CloseAllLoss: All open trades are closed when their total loss reaches the defined percent of account balance. 0 disables this option.
CloseOneDirection: Long or short trades are taken into account separately to calculate the profit or loss for the CloseAllProfit and CloseAllLoss options.
Before installing this expert advisor, access the menu Tools → Options → Expert Advisors and make sure that “Allow DLL imports” is enabled.
Trading system basic rules:
Long signal:
Point 1: The low in a down trending currency market.
Point 2: An upward correction in the downtrend, the highest bar in the correction before the price falls back up point 3.
Point 3: The low in the move down from point 2 but a failure to make a new lower low than point 1.
Go long at the breakout above point 2 level.
Short signal:
Point 1: The high in an up trending currency market.
Point 2: A downward correction in the uptrend, the lowest bar in the correction before the price moves back up to point 3.
Point 3: The high in the move up from point 2 but a failure to make a new higher high than point 1.
Go short at the breakout below point 2 level.
Exits:
When a trendline of point 1 and point 3 is broken by a closed candle.
Entry and exit conditions
ZigZagType: InternalZigZag means ZigZag points are calculated by the EA, DefaultZigZag means default Metatrader ZigZag is used, MABasedZigZag means MABasedZigZag is used, MMLC means MMLCv12 ZigZag is used. In case of InternalZigZag MinSwingBars, MaxSwingBars options define the minimum and maximum allowed bars between neighbouring points.
ClosedCandle: True means a candle should close beyond point 2 level, false means bid should reach that level.
Buffer: Distance between breakout level and point 2 level.
BufferType: Type of buffer. Pips means a value in pips, ATRMultiplier means an ATR based value and StopLoss is calculated as a multiplier of ATR, Distance12 means buffer value is a multiplier of the distance between point 1 and point 2, Distance23 means buffer value is a multiplier of the distance between point 2 and point 3. The same types apply to all similar settings as well.
Min12Distance: Minimum distance between points 1 and 2. 0 means this option is ignored.
Min12DistanceType: Type of Min12Distance.
Max12Distance: Maximum distance between points 1 and 2. 0 means this option is ignored.
Max12DistanceType: Type of Max12Distance.
Min23Distance: Minimum distance between points 2 and 3. 0 means this option is ignored.
Min23DistanceType: Type of Min23Distance.
Max23Distance: Maximum distance between points 2 and 3. 0 means this option is ignored.
Max23DistanceType: Type of Max23Distance.
Trendline: A trendline connects point 1 and point 3. Ignore means this trendline is not taken into account, Entry means no candle has closed at the opposte side of the trendline for a valid entry, Exit means the whole lots are closed when a candle has closed at the opposte side of the trendline, EntryAndExit means Entry and Exit options are both applied.
ExitOnOppositeSignal: The entire trade or any remaining partial lots are closed when an opposite entry signal, defined by the entry settings, occurs.
ReverseSignals: A long signal opens a short trade, closes a long trade and vice versa.
Trade settings
MagicNumber: Magic number of the trade. If more than one chart of the same pair is opened the magic numbers should be different. Different pairs can have the same magic number.
TradeComment: Comment of the trade as shown at the Metatrader terminal.
TradesPerDirection: Maximum allowed number of simultaneously open trades of the same direction. It can be up to 99.
TradesPerSession: Maximum number of trades that can be opened during each trading session. It includes open and closed trades. If there are no trading sessions, it refers to the whole day. 0 disables this option.
OpenTradesPerPattern: Maximum number of open trades per pattern. 0 means unlimited trades.
TotalTradesPerPattern: Maximum of the total number of open and closed trades per pattern. 0 means unlimited trades.
SwingSL: False means the stop loss value is relative to entry price. True means the stop loss is relative to the nearest swing plus spread for shorts. Value of StopLoss option is added as well. All stop loss and take profit settings are hidden from the broker.
PointSL: The stop loss is relative to point 1, 2 or 3 levels plus spread for shorts. Set it to a number from 1 to 3. Value of StopLoss option is added as well. 0 disables this option.
MinimumSLPips: If SwingSL or PointSL is selected, stop loss value should be at least the defined pips. SwingSL is valid only if MinimumSLPips is greater than zero.
MaximumSLPips: If stop loss is greater than the defined pips, it is reduced to MaximumSLPips. 0 disables this option.
StopLoss: Value of stop loss.
StopLossType: Type of stop loss. Pips means a value in pips, ATRMultiplier means an ATR based value and StopLoss is calculated as a multiplier of ATR. The same types apply to the following settings as well.
VisibleSL: Stop loss visible to brokers used in case of disconnection. It is a multiplier of hidden stop loss value.
We can have up or four take profit levels and each of them can have a different type.
TakeProfit1: Value of the first take profit.
TakeProfit1Type: Type of the first take profit.
TakeProfit2: Value of the second take profit.
TakeProfit2Type: Type of the second take profit.
TakeProfit3: Value of the third take profit.
TakeProfit3Type: Type of the third take profit.
TakeProfit4: Value of the fourth take profit.
TakeProfit4Type: Type of the fourth take profit.
VisibleTP: Take profit visible to brokers used in case of disconnection. It is a multiplier of hidden take profit value.
BreakEvenTrigger: The stop loss moves to the entry price after price is in profit for the defined value.
BreakEvenTriggerType: Type of break even trigger.
LockProfit: The stop loss moves to the entry price plus the defined value after price reaches BreakEvenTrigger level.
LockProfitType: Type of LockProfit.
TrailingStart: Trailing stop is activated when price goes above the entry price for longs or below the entry price for shorts, for the defined value.
TrailingStartType: Type of TrailingStart.
TrailingStop: Value of trailing stop loss. Stop loss is continuously modified so that its distance from current price is always the defined value. 0 disables this option.
TrailingStopType: Type of trailing stop loss.
TrailingStep: The trailing stop loss is modified when price exceeds the level at which the previous trailing stop modification occurred, for the defined value.
TrailingStepType: Type of TrailingStep.
CloseProfitableAfterMinutes: At the defined minutes after its opening, a profitable trade is closed.
CloseLosingAfterMinutes: At the defined minutes after its opening, an unprofitable trade is closed.
Slippage: Maximum allowed slippage of trades.
MaxSpread: No trades are opened when spread is greater than the defined pips. 0 disables this option.
CloseOnProfit: True means that if an opposite or exit signal occurs, only profitable or breakeven trades are closed.
Hedge: True means that a long and short trade can be simultaneously open.
MinTradesDistance: Each trade should be opened in a distance from the most recent open trade. This distance should be at least the defined value. 0 disables this option.
MinTradesDistanceType: Type of MinTradesDistance.
AdditionalTrades: ProfitSide means each new trade should be opened lower for shorts or higher for longs, LossSide means each new trade should be opened higher for shorts or lower for longs, from the most recent open trade of the same direction. AnySide disables this option.
CandlesDistance: Minimum number of candles between open trades of the same direction. 0 means we can open multiple trades during a candle.
SendEmail: Disabled means no email, TradeOpening means an email is sent only when a trade is opened, TradeClosing means an email is sent only when a trade is closed, TradeOpeningOrClosing means an email is sent in both cases.
SendNotifications: Disabled means no push notification, TradeOpening means a notification is sent only when a trade is opened, TradeClosing means a notification is sent only when a trade is closed, TradeOpeningOrClosing means a notification is sent in both cases.
Alerts: Disabled means no alerts, TradeOpening means alerts only when a trade is opened, TradeClosing means alerts only when a trade is closed, TradeOpeningOrClosing means alerts in both cases.
AlertSound: Play the defined sound file with an alert. The sound file should be placed in the sounds directory of Metatrader. Set it to blank for no sound.
ScreenShots: Screenshots are saved in the files folder at the opening and closing of a trade. Disabled means no screenshots, TradeOpening means a screen shot is saved only when a trade is opened, TradeClosing means a screen shot is saved only when a trade is closed, TradeOpeningOrClosing means a screen shot is saved in both cases.
LongColour: Arrow colour of long trades.
ShortColour: Arrow colour of short trades.
LabelFontColour: Colour of the labels that show information of the expert advisor.
Trading hours settings
All hour based settings are in hhmmhhmm format and refer to GMT. The first four digits define the start time and the last four digits the end time. Up to three trading sessions can be used. Set it to “00002400” to trade all day.
AutoGMTOffset: Difference between server time and GMT, defined automatically by the EA. It can’t be used during backtests.
ManualGMTOffset: Difference between server time and GMT, defined manually.
DSTOffset: If ManualGMTOffset is used, Daylight Saving Time correction is automatically applied according to the European Union rules.
TradingSession1: Trading hours restrictions for the first trading session.
TradingSession2: Trading hours restrictions for the second trading session.
TradingSession3: Trading hours restrictions for the third trading session.
MondayOpenHour: For each week, new trades are only opened after this hour of Monday. It is in hhmm format. Set it to blank to disable this option.
FridayCloseHour: Hour of Friday when all trades are closed and no new ones are opened to avoid the weekend gap. It is in hhmm format. Set it to blank to disable this option.
FridayCloseTrades: At FridayCloseHour open trades are closed. None means no trades are closed, ProfitableTrades means only profitable trades are closed, LosingTrades means only losing trades are closed, AllTrades means all trades are closed.
TradingDays: Comma separated days of the week that allow trading.
NewsFilter: No new trades are opened during news period.
MinutesBeforeNews: The NewsFilter is active for the defined number of minutes before news.
MinutesAfterNews: The NewsFilter is active for the defined number of minutes after news.
Money management settings
Lots: The lot size if money management is not used.
Partial exits can occur in up to four stages.
PartialClose1: Percent of the initial lots that is closed when the first exit occurs.
PartialClose2: Percent of the initial lots that is closed when the second exit occurs.
PartialClose3: Percent of the initial lots that is closed when the third exit occurs. If there are any remaining lots, they are closed by the fourth exit.
MoneyManagement: True means that the lot size is defined by the money management.
EquityPercent: Lot size is a percent of account equity. 0 disables this option.
StopLossRisk: Percent of account balance to risk for each trade, if it hits stop loss. 0 disables this option. Only one of EquityPercent or StopLossRisk can be used.
Martingale: Percentage means a LotMultiplier percentage is added to the lot size after a loss, Multiplication means the lot size is multiplied by LotMultiplier after a loss. Martingale is activated only after the initial lots of a trade are closed at loss because of stop loss.
StartMartingaleAfterSL: The martingale sequence starts after the defined number of consecutive unprofitable closed trades.
LotMultiplier: Lot size increase factor in case of Martingale.
MaxMartingaleSequence: The maximum number of consecutive martingaled trades.
CloseAllProfit: All open trades are closed when their total profit reaches the defined percent of account balance. 0 disables this option.
CloseAllLoss: All open trades are closed when their total loss reaches the defined percent of account balance. 0 disables this option.
CloseOneDirection: Long or short trades are taken into account separately to calculate the profit or loss for the CloseAllProfit and CloseAllLoss options.
Before installing this expert advisor, access the menu Tools → Options → Expert Advisors and make sure that “Allow DLL imports” is enabled.