=================================================================================================================================================================================================================================== =================================================================================================================================================================================================================================== =================================================================================================================================================================================================================================== The strategy rules are simple: when the price is BELOW the BBANDS_LOWER_LINE we open a BUY order, if the price goes against us and continue going DOWN we add another BUY order only if the price is BELOW X amount of pips between our last BUY order (Each order thats added the lot of would be multiplied X2), when the price is ABOVE the BBANDS_UPPER_LINE we open a SELL order, if the price goes against us and continue going UP we add another SELL order only if the price is ABOVE X amount of pips between our last SELL order (Each order thats added the lot of would be multiplied X2), Close all the orders if price hit the BBANDS_CENTER_LINE. ++ There should be a TextObject on the graph that displays the MAXDD%. ** The whole code must be professional and CPU/RAM efficient so that the optimizations and backtests could be fast as possible, thank you. ** A parameter called "DEBUG", if DEBUG=True, then some TextObjects/Text Log will be appeared on the Graph which point the last order's (Slippage, Spread, Execution time in ms) =================================================================================================================================================================================================================================== =================================================================================================================================================================================================================================== =================================================================================================================================================================================================================================== == MagicNumbers Managment == OrderMagicNumbersMarketOrdersBUYS=100 //(the magicnumbers of market BUY orders, for example the first SELL order will always starts with maginumber 100, every next BUY order that is opened would have a +1 to the magicnumber so the first BUY order would be 100, next opened BUY order would be 101, next 102, etc..) OrderMagicNumbersMarketOrdersSELLS=200 //(the magicnumbers of market SELL orders, for example the first SELL order will always starts with maginumber 200, every next SELL order that is opened would have a +1 to the magicnumber so the first SELL order would be 200, next opened SELL order would be 201, next 202, etc..) =================== =================== == Conditions == OrderComment=MyEA //(comment for each order of the EA.) OrderMaximumSpread=5.0 //(maximum spread in pips, if the spread higher than this parameter the order wont be opened.) OrderMaximumSlippage=99.0 //(maximum slippage in pips, if the slippage is higher than this parameter the order wont be opened.) =================== =================== OrderMarketExecution=True //(OrderOpen will include SL/TP as 0, then OrderModify should add the SL/TP values.) OrderInstantExecution=False //(OrderOpen will include SL/TP as they are, OrderModify is not needed here.) =================== =================== OrderLotSize=0.01 //(Order's lot size.) OrderRiskInPercentage=0.0 //(risk in perecentage.) OrderRiskCalculationMethod=CalculateFromBalance //(risk calculation method of parameter "OrderRiskInPercentage", this should have 2 options: CalculateFromBalance/CalculateFromEquity.) OrderMinimumLotSize=0.01 //(the minimum lot the EA can use.) OrderMaximumLotSize=100.0 //(the maximum lot the EA can use.) MaximumOpenTrades=999 //(the maximum open trades that can be taken.) NumberOfTradesPerBar=1 //(number of trades that can be taken inside 1 bar.) =================== =================== Martingale=True //(martingle on/off) AntiMartingle=False //(antimartingale on/off (it is a reversed martingle, each order that closed in profit it will double it lotsize, rather then reducing the lotsize.) Multiplier=2.0 //(in what increments the lotsize of the martingle/antimartingle would be placed.) MaximumMatringaleRiskInPercentage=5.0 //(what is the maximum risk in % of accountbalance/accountequity the martingale would be till.) MaximumMatringaleRiskCalculationMethod=CalculateFromBalance //(risk calculation method of parameter "MaximumMatringaleRiskInPercentage", this should have 2 options: CalculateFromBalance/CalculateFromEquity.) =================== =================== MultiplyEachNewOpenedOrder=True //(multiply each new opened order.) =================== =================== CloseByOppositeRule=Flase //(the EA will close the order if the opposite rule for it shows up.) ReverseStrategyRules=False //(will reverse the buy rule to the sell rule and the sell rule to the buy rule.) =================== ================== CloseAfterXBars=0 //(close order/s after X amount of closed bars, 0=off/1 or above means that after how many bars we close the order/s.) CloseAfterXBullishBars=0 //(close order/s after X amount of closed bullish bars, 0=off/1 or above means that after how many bars we close the order/s.) CloseAfterXBearishBars=0 //(close order/s after X amount of closed bearish bars, 0=off/1 or above means that after how many bars we close the order/s.) =================== =================== StepInPIPSBetweenEachOrder=50.0 //(step between each order in pips, for example only after each 50 pips from the last opened order it will be allowed to open another same diraction order.) StepInBARSBetweenEachOrder=0 //(step between each order in bars, for example only after each 5 bars from the last opened order it will be allowed to open another same diraction order.) =================== =================== == Order Managment == HiddenTargets=False //(if True all the targets like TP/SL/TS/BE would be all hidden, *I must see them via a horizontal line with different colors for TP=Lime/SL=Red/TS=Aqua/BE=Gray*) StopLoss=0 TakeProfit=0 tralingstart=0 //(profit in pips required to enable the trailing stop.) tralingstop=0 //(trailing stop.) breakevenstart=0 //(gain in pips required to enable the break even.) breakeven=0 //(break even.) =================== =================== == Trading hours and days == StartTradingAt=00:00 //(allow opening of trades at..) EndTradingAt=00:00 //(do not allow openning trades at..) tradeMON=True tradeTUE=True tradeWED=True tradeTHU=True tradeFRI=True tradeSAT=True tradeSUN=True CloseAllOrdersAtSpecificDay=False //(if True it will close all the orders at the DayOfWeek that is setted in parameter "CloseAllOrdersAtDay", if False then it will be off.) CloseAllOrdersAtDay=5 //(close all the trades on day 5 [FRIDAY].) CloseAllOrdersAtClosingDayAtTime=00:00 =================== =================== BBands=50 =================================================================================================================================================================================================================================== =================================================================================================================================================================================================================================== ===================================================================================================================================================================================================================================