Job finished
Specification
An MT5 Trading Robot that scans the first 26 Forex Symbols in Market Watch to find one that complies with 7 criteria.
Long Trade:
Main Trend 1: SMMA of current bar higher than the oldest bar in history. (Periods,timeframes,shifts,etc,entered by client, not a user input.)
Secondary Trend 2: SMMA of Symbol rising.
Short Term Trend 3: SMA of current bar higher than previous bar.
Entry Point 4: iClose < SMA.
Strength 5: iRSI rising.
Swap 6: Symbol swaprate >0.
Spread 7: From a list of the 26 Symbols containing their appropriate spread.
Short Trade opposite, except swaprate >0 and spread OK.
When symbol is identified and no trades open, chart symbol is changed to match and chart and time frame is changed to daily.
Lots to trade: User input 1 = fixed lot size, 0 to use %.
Lots to trade as % of Account Balance: User input 2 = Dropdown List, Lots per 100K of Account Balance, 0.1, 0.25, 0.50, 1.00, 2.00.
Closed for the Weekend if no trades open 8 hours before market close friday. User Input 3 = Yes or No.
Magic Number: User Input 4:
Stop Loss 5000 pips, Take Profit 5000 pips.
To Close first order: We need a variable called High Water Mark that increases to reflect the accumulated profits of the current magic number when the order closes, it only increases to form a higher number when profits exceed the previous HWM it never decreases.
If OrdersTotal()==1) If(OrderProfit()>(High Water Mark of magic number + 20*OrderLots() and spread is OK) Close the order. Example OrderLots 1.00 X 20 = $20.00.
If the order is losing > 250 pips and the Open Symbol complies with all the entry criteria open another position on the same Symbol with lot size of last lots + Lots to trade.
Close the second order if the second order profit > 10*Second Order OrderLots().
Repeat this process without opening more than 5 Trades.
Source code is required.