Brivo signal
Created on 6/1/2019 2:13:45 PM
extern double LotSize = 1;
extern double StopLoss = 50;
extern double TakeProfit = 0;
extern double TrailingStopLimit = 10;
extern double TrailingStopStop = 10;
extern int MagicNumber = 23310;
// Global variables
int LongTicket;
int ShortTicket;
double RealPoint;
// Init function
int init()
{
RealPoint = RealPipPoint(Symbol());
}
// Start function
int start()
{
// Long
OrderSelect(LongTicket,SELECT_BY_TICKET);
if(OrderCloseTime() != 0 || LongTicket == 0)
{
bool buy_condition_1 = iMA(NULL, 0, 12, 0, MODE_SMA, PRICE_CLOSE, 0) > Ask + 0.0005 ;
if( buy_condition_1 )
{
OrderSelect(ShortTicket,SELECT_BY_TICKET);
if(OrderCloseTime() == 0 && ShortTicket > 0)
{
bool Closed = OrderClose(ShortTicket,OrderLots(),Ask,0,Red);
}
LongTicket = OrderSend(Symbol(),OP_BUY,LotSize,Ask,0,0,0,"Buy Order",MagicNumber,0,Green);
OrderSelect(LongTicket,SELECT_BY_TICKET);
double OpenPrice = OrderOpenPrice();
if(StopLoss > 0) double LongStopLoss = OpenPrice - (StopLoss * RealPoint);
if(TakeProfit > 0) double LongTakeProfit = OpenPrice + (TakeProfit * RealPoint);
if(LongStopLoss > 0 || LongTakeProfit > 0)
{
bool LongMod = OrderModify(LongTicket,OpenPrice,LongStopLoss, LongTakeProfit,0);
}
ShortTicket = 0;
}
}
if (TrailingStopLimit > 0 && TrailingStopStop > 0)
{
double TrailingStopLimitReal = TrailingStopLimit * RealPoint;
double TrailingStopStopReal = TrailingStopStop * RealPoint;
OrderSelect(LongTicket, SELECT_BY_TICKET);
if (OrderType() == OP_BUY && OrderCloseTime() == 0)
{
if(Bid - OrderOpenPrice() > TrailingStopLimitReal)
{
if(OrderStopLoss() < Bid - (TrailingStopLimitReal * 2))
{
double LongTrailingStopLoss = OrderStopLoss() + TrailingStopStopReal;
OrderModify(OrderTicket(), OrderOpenPrice(), LongTrailingStopLoss, OrderTakeProfit(), 0, MediumSeaGreen);
}
}
}
OrderSelect(ShortTicket, SELECT_BY_TICKET);
if (OrderType() == OP_SELL && OrderCloseTime() == 0)
{
if(OrderOpenPrice()- Ask > TrailingStopLimitReal)
{
if(OrderStopLoss() > Ask + (TrailingStopLimitReal * 2))
{
double ShortTrailingStopLoss = OrderStopLoss() - TrailingStopStopReal;
OrderModify(OrderTicket(), OrderOpenPrice(), ShortTrailingStopLoss, OrderTakeProfit(), 0, MediumSeaGreen);
}
}
}
}
return(0);
}
// Pip Point Function
double RealPipPoint(string Currency)
{
int CalcDigits = MarketInfo(Currency,MODE_DIGITS);
if(CalcDigits == 2 || CalcDigits == 3) double CalcPoint = 0.01;
else if(CalcDigits == 4 || CalcDigits == 5) CalcPoint = 0.0001;
return(CalcPoint);
}
This indicator can be used as a signal provider for
LOCTrader Expert Advisor.
EURUSD
USDJPY
GBPUSD
USDCHF
M1
M5
M15
M30
Hourly
H4
Daily
Buy Signals
Condition 1
Moving Average 14 Simple Open
Points Up (growing)
Sell Signals
Condition 2
Moving Average 14 Simple Open
Points Down (lowering)
To download this signal indicator you need to register or login. It is free.
Please Login
Password is required.
|
Create Account
First Name is required.
Last Name is required.
Email is required.
This Email address is already registered.
Password is required.
Password and confirm password fields must be same.
This is a custom indicator for Metatrader 4 platform. To use it you need:
- Download this indicator and copy into your metatrader experts/indicators folder.
- Restart your Metatrader 4 terminal.
- Indicator will appear under Custom Indicators section. Attach the indicator on the chart.