/*[[ Name := Im_Exhausted Author := Copyright © 2005, David W Honeywell Link := DavidHon@msn.com Lots := 1.00 Stop Loss := 40 Take Profit := 100 Trailing Stop := 30 ]]*/ // Time Chokes If year<2005 Then Exit; If TimeMonth(T)<1 Then Exit; If TimeDay(T)<1 Then Exit; // User Defined Variables Define: Hour_Begin(0);// This is the hour on the chart that you want this to set trades Define: Periods_Back(18);// This finds the high and low , set for how many periods you want to use Define: Range_Plus_Minus(15);// This is the range +/- of the high and also the +/- of the low ( Periods_Back ) Define: slippage(3); // Variables that change according to price action Var: cnt(0); Var: Highe(0); Var: Lowes(0); Var: Plus_High(0); Var: Minus_High(0); Var: Plus_Low(0); Var: Minus_Low(0); Var: Current_Price(0); // Number of open trades Variable Var: Open_Trades(0); // Time Delay Variable Var: Trade_Delay(0); // Price Action Variables Definitions Highe = High[Highest(MODE_HIGH,Periods_Back,Periods_Back)]; Lowes = Low[Lowest(MODE_LOW,Periods_Back,Periods_Back)]; Plus_High = Highe+Range_Plus_Minus*Point; Minus_High = Highe-Range_Plus_Minus*Point; Plus_Low = Lowes+Range_Plus_Minus*Point; Minus_Low = Lowes-Range_Plus_Minus*Point; Current_Price = (ask+bid)/2*point; // Number of Open Trades Variable Definition Open_Trades = 0; // Time Variable Definition , will not allow expert to make more than 1 trade per period Trade_Delay = Period*60; // Price Choke , if price Range overlaps no trades are allowed If (Current_Price>Minus_High and Current_PriceTrade_Delay) Then { // Set Order according to our price conditions If (Plus_High>ask and ask>Minus_High) Then { SetOrder(OP_SELL,1,bid,slippage,bid+stoploss*point,bid-takeprofit*point,Gold);Exit; }; If (Plus_Low>bid and bid>Minus_Low) Then { SetOrder(OP_BUY,1,ask,slippage,ask-stoploss*point,ask+takeprofit*point,white);Exit; };};}; //---------------------------------------------------------------------------------------------------------- // If 1 or more Open trade(s) Begin If Symbol==Symbol and Open_Trades>0 Then { // Price Choke , if price Range overlaps no trades are allowed If (Current_Price>Minus_High and Current_PriceTrade_Delay) Then { // Set Order according to our price conditions If (Plus_High>ask and ask>Minus_High) Then { SetOrder(OP_SELL,1,bid,slippage,bid+stoploss*point,bid-takeprofit*point,Gold);Exit; }; If (Plus_Low>bid and bid>Minus_Low) Then { SetOrder(OP_BUY,1,ask,slippage,ask-stoploss*point,ask+takeprofit*point,white);Exit; };};}; // Trailing Stop Choke , trailing stop must be more than 5 if TrailingStop<5 then { print("Invalid trailing stop"); Exit; }; // Open Trades Confirmation , All Trades For cnt=1 to TotalTrades { // Open Trades per Symbol Counter If OrderValue(cnt,Val_Symbol)=Symbol Then { Open_Trades=Open_Trades+1; }; // Trailing Stop If Ord(cnt,Val_Symbol)=Symbol and Ord(cnt,VAL_TYPE)=OP_BUY then { If (Bid-Ord(cnt,VAL_OPENPRICE))>(TrailingStop*Point) then { If Ord(cnt,VAL_STOPLOSS)<(Bid-TrailingStop*Point) then { ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE), Bid-TrailingStop*Point,Ord(cnt,VAL_TAKEPROFIT),Red); Exit; }; }; }; If Ord(cnt,Val_Symbol)=Symbol and Ord(cnt,VAL_TYPE)=OP_SELL then { If (Ord(cnt,VAL_OPENPRICE)-Ask)>(TrailingStop*Point) then { If Ord(cnt,VAL_STOPLOSS)>(Ask+TrailingStop*Point) or Ord(cnt,VAL_STOPLOSS)=0 then { ModifyOrder(Ord(cnt,VAL_TICKET),Ord(cnt,VAL_OPENPRICE), Ask+TrailingStop*Point,Ord(cnt,VAL_TAKEPROFIT),Red); Exit; }; }; }; };