/*[[ Name :=SUPERSIGNALS EXPERT Author := Nick Bilak c 2005 Link := Notes := Enters BUY when BLUE ARROW. SELLS when RED ARROW. Lots := 1.00 Stop Loss :=0 Take Profit := 0 Trailing Stop := 0 ]]*/ ///////////////////////////////////////////////////// // Defines ///////////////////////////////////////////////////// Defines: Slippage(3); // Slippage Defines: TradesPerCurrency(1); // Number of lots to trade DEFINES: StopYear(2005),StopMonth(1); DEFINES: Start_Time(0),endofDAY(23); ///////////////////////////////////////////////////// // Variables ///////////////////////////////////////////////////// var: OpenSell(0); // Sell Trades Counter var: OpenBuy(0); // Buy Trades Counter var: PriceOpen(0); // Price Open var: I(0),cnt(0),vTime(0); // Misc Counter var: Mode(0); // Squirl the Mode variable for multiple use var: pattern(0); var: BullEngulf(False), MorningStar(False), BullPierce(False), Hammer(False), BearEngulf(False), EveningStar(False), DarkCloud(False), Shooter(False); BullEngulf=UserFunction("SpotOn",BullEngulf); MorningStar=UserFunction("SpotOn",MorningStar); BullPierce=UserFunction("SpotOn",BullPierce); MorningStar=UserFunction("SpotOn",MorningStar); BearEngulf=UserFunction("SpotOn",BearEngulf); Shooter=UserFunction("SpotOn",Shooter); Hammer=UserFunction("SpotOn",Hammer); EveningStar=UserFunction("SpotOn",EveningStar); ///////////////////////////////////////////////// // Main Script Conditions ///////////////////////////////////////////////// If Curtime - LastTradeTime < 10 then Exit; //If FreeMargin < 500 then Exit; if year < StopYear then exit; if month < StopMonth and year <> 2005 then exit; //If (DayOfWeek <2 or DayOfWeek >6 or hour < Start_Time or hour > End_Time) then exit; ///////////////////////////////////////////////////// // Calculations / Setting Values ///////////////////////////////////////////////////// OpenSell = 0; OpenBuy = 0; for I = 1 to TotalTrades { Mode = ord(I, VAL_TYPE); if ord(I, VAL_SYMBOL) == Symbol then { //Calculates how many Sell we have for the current Symbol if Mode == OP_SELL then { OpenSell++; }; //Calculates how many Buy we have for the current Symbol if Mode == OP_BUY then { OpenBuy++; }; }; }; ///////////////////////////////////////////////// // CUSTOM INDICATORS ///////////////////////////////////////////////// ///////////////////////////////////////////////// // Comment on the chart ///////////////////////////////////////////////// ///////////////////////////////////////////////// // Long/Short Entry and Re-entry Trades ///////////////////////////////////////////////// If OpenBuy < TradesPerCurrency then { if vTime != Time[0] then { IF Hour > Start_Time and iCustom("supersignals",MODE_SECOND,0) !=0 and MorningStar=true or BullEngulf=true or Hammer=true or BullPierce=true THEN { Alert(Symbol, " BUY ALERT. Buy at ", PRICEASK , " or better.",MorningStar,BullEngulf,Hammer,BullPierce); SetOrder(OP_BUY, Lots,ASK, Slippage,0 ,0 , BLUE); vTime = Time[0]; Exit; }; }; }; If OpenSell < TradesPerCurrency then { if vTime != Time[0] then { IF Hour > Start_Time and iCustom("supersignals",MODE_FIRST,0) !=0 and DarkCloud=true or BearEngulf=true or EveningStar=True or Shooter=True THEN { Alert(Symbol, " SELL ALERT. Sell at ", PRICEBID , " or better."); SetOrder(OP_SELL, Lots,BID, Slippage,0,0, RED); vTime = Time[0]; Exit; }; }; }; ///////////////////////////////////////////////// // Trade Management ///////////////////////////////////////////////// for I = 1 to TotalTrades { Mode = ord(I, VAL_TYPE); if ord(I, VAL_SYMBOL) == Symbol then { If OpenBuy > 0 then { if iCustom("supersignals",MODE_FIRST,0) !=0 then { Alert("TREND CHANGE *** Closing order at market for " + Symbol + " on " + Period + " Period."); CloseOrder(ord(I, VAL_TICKET), ord(I, VAL_LOTS), PRICEBID, Slippage, yellow); Exit; }; // // If 10 pips profit, move Stop to BreakEven // if PRICEBID - ord(I, VAL_OPENPRICE) >= BreakEvenSL * Point and ord(I, VAL_STOPLOSS) < ord(I, VAL_OPENPRICE)) then // { // ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), ord(I, VAL_OPENPRICE), ord(I, VAL_TAKEPROFIT), Cyan); // Exit; // }; // PSAR Stop...MOVING TRAILING STOP // if psar > psar2 and ord(I, VAL_STOPLOSS) != psar and (Bid - psar) and (psar < Bid) then // { // ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), psar, ord(I, VAL_TAKEPROFIT), BlueViolet); // Exit; // }; }; If OpenSell > 0 then { if iCustom("supersignals",MODE_SECOND,0) !=0 then { Alert("TREND CHANGE *** Closing order at market for " + Symbol + " on " + Period + " Period."); CloseOrder(ord(I, VAL_TICKET), ord(I, VAL_LOTS), PRICEASK, Slippage, yellow); Exit; }; // // If 10 pips profit, move Stop to BreakEven // if ord(I, VAL_OPENPRICE) - PRICEASK >= BreakEvenSL * Point and ord(I, VAL_STOPLOSS) > ord(I, VAL_OPENPRICE)) then // { // ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), ord(I, VAL_OPENPRICE), ord(I, VAL_TAKEPROFIT), Cyan); // Exit; // }; // Psar Stop...MOVING TRAILING STOP // if (psar < psar2) and (ord(i, VAL_STOPLOSS) != psar) and (psar - Ask ) and (psar > Ask) then // { // ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), psar , ord(I, VAL_TAKEPROFIT), BlueViolet); // Exit; // }; }; // }; };