|
/*[[
Description: Awesome Scalper V1.3 Awesome Oscillator auto Trader
for 15 minutes charts
Name := 2Extreme4U - Awesome Scalper 1.3
Author := 2Extreme4U
Link := www.omniscienttrader.com
Notes := Scalping expert/Trend follower
Lots := 1.00
Stop Loss := 25
Take Profit := 50
Trailing Stop := 15
]]*/
/////////////////////////////////////////////////////
// Defines
/////////////////////////////////////////////////////
Defines: Slippage(5); // Slippage
Defines: EMA1(11); // EMA 10
Defines: PSARStep(0.0150); // Parabolic SAR Step
Defines: PSARMaximum(0.2000); // Parabolic SAR Maximum
Defines: PrimaryTarget(29); // Primary target to close 1 lot
Defines: BreakEvenSL(11); // Number of points made before the stop is moved to breakeven
Defines: TradesPerCurrency(1); // Number of lots to trade
/////////////////////////////////////////////////////
// Variables
/////////////////////////////////////////////////////
var: EMA101(0), EMA102(0); // EMA 10 Values
var: Psar(0), PsarP(0); // Parabolic SAR Value
var: Awesome(0), AwesomeP(0), AwesomePP(0); // Awesome Occillator Value
var: Accel(0), AccelP(1); // Accelerator Occillator Value
var: OpenSell(0); // Sell Trades Counter
var: OpenBuy(0); // Buy Trades Counter
var: PriceOpen(0); // Price Open
var: I(0); // Misc Counter
var: Mode(0); // Squirl the Mode variable for multiple use
/////////////////////////////////////////////////
// Main Script Conditions
/////////////////////////////////////////////////
If Curtime - LastTradeTime < 5 then Exit;
If FreeMargin < 500 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++;
};
};
};
Awesome = iAO(0);
AwesomeP = iAO(1);
AwesomePP = iAO(2);
Accel = iAC(0);
AccelP = iAC(1);
Psar = iSAR(PSARStep, PSARMaximum, 0);
PsarP = iSAR(PSARStep, PSARMaximum, 1);
/////////////////////////////////////////////////
// Comment on the chart
/////////////////////////////////////////////////
/////////////////////////////////////////////////
// Long/Short Trade Opening
/////////////////////////////////////////////////
If OpenBuy < TradesPerCurrency then
{
// Buy 4 points higher than last candle close
PriceOpen = Close[1] + 4 * Point;
If Awesome > 0 and AwesomeP > 0 and Awesome > AwesomeP and AwesomePP < 0 and Accel > AccelP and Psar < Ask then
{
if High[0] >= High[1] then
{
Alert(Symbol, " BUY ALERT. Awesome Scalper. Buy at ", PriceOpen, " or better.");
if Ask <= PriceOpen then
{
SetOrder(OP_BUY, Lots, Ask, Slippage, Psar, Ask + TakeProfit * Point , BLUE);
Exit;
};
};
};
};
If OpenSell < TradesPerCurrency then
{
// Buy 4 points lower than last candle close
PriceOpen = Close[1] - 4 * Point;
If Awesome < 0 and AwesomeP < 0 and AwesomePP > 0 and Accel < AccelP and Psar > Bid then
{
If Low[0] <= Low[1] then
{
Alert(Symbol, " SELL ALERT. Awesome Scalper. Sell at ", PriceOpen, " or better.");
if Bid >= PriceOpen then
{
SetOrder(OP_SELL, Lots, Bid, Slippage, Psar, Bid - TakeProfit * Point, RED);
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 Primary target is met, close half play and move stop to 0 for other lot.
if (Bid - ord(I, VAL_OPENPRICE)) >= PrimaryTarget * Point then
{
Alert("Primary Target met. BID = " + Bid + ". Closing order at market for " + Symbol + " on " + Period + " Period.");
CloseOrder(ord(I, VAL_TICKET), ord(I, VAL_LOTS), Bid, Slippage, Orange);
Exit;
};
// PSAR Stop
if Psar > PsarP and ord(I, VAL_STOPLOSS) != Psar and (Bid - Psar >= 4) and (Psar < Bid) then
{
ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), Psar, ord(I, VAL_TAKEPROFIT), BlueViolet);
Exit;
};
// If 10 pips profit, move Stop to BreakEven
if bid - 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 has changed direction so we want to exit at breakeven
if psar > Bid and ceil(ord(i, VAL_OPENPRICE)*10000) != ceil(ord(I, VAL_TAKEPROFIT)*10000) then
{
ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), ord(I, VAL_OPENPRICE), ord(I, VAL_OPENPRICE), Orange);
Exit;
};
*/
};
If OpenSell > 0 then
{
//If Primary target is met, close half play and move stop to 0 for other lot.
if (ord(I, VAL_OPENPRICE) - Ask) >= PrimaryTarget * Point then
{
Alert("Primary Target met. Ask = " + Ask + ". Closing order at market for " + Symbol + " on " + Period + " Period.");
CloseOrder(ord(I, VAL_TICKET), ord(I, VAL_LOTS), Ask, Slippage, Orange);
Exit;
};
// Psar Stop
if (Psar < PsarP) and (ord(i, VAL_STOPLOSS) != Psar) and (Psar - Ask >= 4) and (Psar > Ask) then
{
ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), Psar, ord(I, VAL_TAKEPROFIT), BlueViolet);
Exit;
};
// If 10 pips profit, move Stop to BreakEven
if ord(I, VAL_OPENPRICE) - Ask >= 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 has changed direction so we want to exit at breakeven
if psar < Ask and ceil(ord(i, VAL_OPENPRICE)*10000) != ceil(ord(I, VAL_TAKEPROFIT)*10000) then
{
ModifyOrder(ord(I, VAL_TICKET), ord(I, VAL_OPENPRICE), ord(I, VAL_OPENPRICE), ord(I, VAL_OPENPRICE), Orange);
Exit;
};
*/
};
};
}; |
|