PDA

View Full Version : Candlestick Pattern Indicator and Expert Advisor Programming



aurora
05-29-2014, 07:20 AM
We all is know if the candlestick is important tools for know the market power, bullish or bearish. at this moment I will share Candlestick Expert Advisors srcipt. I hope this can help you to create the expert advisors based on candelstick. next I will attach candlestick indicator.



Script part 1 :

//+——————————————————————+
//| candles percent lot.mq4 |
//| auroa |
//| auroraalpha |
//+——————————————————————+
#property copyright “auroa”
#property link “auroraalpha”
//—- input parameters
extern double TakeProfit = 1000;
extern double StopLoss = 100;
extern double TrailingStop = 80;
extern double TradeSizePercent = 15;
extern double TurnSourLimit = 50;
extern string Order_Comment = “CANDLESTICKS”;
extern bool UseFilter = true;
extern bool Pyramiding = true;

static double initialOrderBuyPrice = 0;
static double initialOrderSellPrice = 0;

//+——————————————————————+
//| expert initialization function |
//+——————————————————————+
int init()


Continue, becasue the text is too loong.

aurora
05-30-2014, 01:24 PM
continue part II

{
//—-

//—-
return(0);
}
//+——————————————————————+
//| expert deinitialization function |
//+——————————————————————+
int deinit()
{
//—-

//—-
return(0);
}
//+——————————————————————+
//| expert start function |
//+——————————————————————+
datetime Time0 = 0;

aurora
05-31-2014, 01:11 PM
part III

int start()
{
//—-
int cnt, ticket, total;
datetime orderclosetime;
string rightnow;
int rightnow2;
int historyTotal;
int difference;
double PBullStop;
double PBearStop;
bool BullCondition;
bool BearCondition;

if (Time0 != Time[0])
{

quadsi
05-31-2014, 02:10 PM
you realy help me to create the expert advisor based on candlestick, I think this type robot really can help me to increase my profit percentage in forex trading. thank you for share this one type.

aurora
05-31-2014, 03:22 PM
candlestick is realy help to use on trading activities, becasue we know main based on trading indicator is not MA, Stochastic or Alligator however major required skill in forex is canldestick pattern. so with this EA candlestick I hope can help all in forex trading activites.

quadsi
05-31-2014, 03:56 PM
candlestick is realy help to use on trading activities, becasue we know main based on trading indicator is not MA, Stochastic or Alligator however major required skill in forex is canldestick pattern. so with this EA candlestick I hope can help all in forex trading activites.

yeah I know this expert advisor, I dont know how to use this script for create the robot. I hope you can help me to give the advice for use this script.

aurora
05-31-2014, 04:10 PM
good forex expert advisors will give great results in our trading, and therefore try to test your trading robot first before using it. next time I will attach EA, script and description for use it.

aurora
06-01-2014, 07:53 AM
Part IV

int n, i;
double zag, zig;
i=0;
while(n<2)
{
if(zig>0) zag=zig;
zig=iCustom(NULL, 0, “ZigZag”, 0, i);
if(zig>0) n+=1;
i++;

//Print(“Zig = “, zig, ” Zag = “, zag);
}

//Bullish Engulfing

quadsi
06-01-2014, 09:24 AM
wow is great you can use mql programming language, but for me this is very hadr to use, so i hope you in next time can attach the candlestick ea in here so i can use it.

aurora
06-02-2014, 10:24 AM
part V

if (UseFilter)
BullCondition = ((BullishEngulfingExists() && zig – Close[1]>= 25*Point) || (BullishHaramiExists() && zig – Close[1]>= 50*Point)) && Close[1] > iMA(NULL,0,200,0,MODE_SMA,PRICE_CLOSE,1);
else
BullCondition = ((BullishEngulfingExists() && zig – Close[1]>= 25*Point) || (BullishHaramiExists() && zig – Close[1]>= 50*Point));

aurora
06-03-2014, 01:17 PM
Part VI

if (BullCondition)
{
if (zag < zig )
{

if (DojiAtBottomExists())
Order_Comment = “DojiAtBottom”;
else if (BullishEngulfingExists())
Order_Comment = “BullishEngulfing”;
else
Order_Comment = “BullishHarami”;

aurora
06-04-2014, 07:12 AM
ticket = OrderSend(Symbol(), OP_BUY, LotsOptimized(), Ask, 3, Ask – StopLoss*Point, Ask + TakeProfit*Point, Order_Comment, 12345, 0, Green);
Print(“Number of Open Orders = “, OrdersTotal());
OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES);
initialOrderBuyPrice = OrderOpenPrice();
}
}

aurora
06-05-2014, 02:46 PM
if (UseFilter)
BearCondition = ((SpinningTopExists() && High[1] == zag) || LongUpCandleExists()) && Close[1] < iMA(NULL,0,200,0,MODE_SMA,PRICE_CLOSE,1);
else
BearCondition = ((SpinningTopExists() && High[1] == zag) || LongUpCandleExists());

aurora
06-06-2014, 11:09 AM
//if((LongDownCandleExists() && High[1] == zag)|| LongUpCandleExists())
//if (DojiAtTopExists() || BearishEngulfingExists())
if(BearCondition)
//if(LongUpCandleExists())
{

aurora
06-07-2014, 12:22 PM
if (zag > zig && zag – zig >= 25*Point)
{

if (SpinningTopExists())
Order_Comment = “Spinning Top”;
else
Order_Comment = “Long Up Candle”;

aurora
06-08-2014, 05:35 AM
ticket = OrderSend(Symbol(), OP_SELL, LotsOptimized(), Bid, 3, Bid + StopLoss*Point, Bid – TakeProfit*Point, Order_Comment, 12345, 0, Red);
OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES);
initialOrderSellPrice = OrderOpenPrice();
Print(“Initial Order Sell Price = “, initialOrderSellPrice);
}
}

aurora
06-09-2014, 01:13 PM
MPCandle part 1

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Yellow
#property indicator_width1 2
//--- parameters
extern string desc = "(Base on PERIOD values, must be smaller than the chart time frame) base_period = 1, 5, 15, 30, 60, 240...etc.";
extern int base_period = 1; //set base_period to 1 is best for M5 and M15; set to 5 is best for H4 and D1
extern int max_counting_bars = 250;

extern bool show_static = true;
extern int static_show_n = 250;
extern color static_txt_color = Black;

//--- buffers
double FocusBuffer[];
double tempBuffer[500][2];
double staticBuffer[];
int idx = 0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{

aurora
06-10-2014, 09:57 AM
Time0 = Time[0];
}
//—-
total = OrdersTotal();
/*historyTotal=OrdersHistoryTotal();

for(cnt=0;cnt<historyTotal;cnt++)
{
if(OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY)==true)
{
if (OrderSymbol()==Symbol()) // hdb – only symbol and magic
{

aurora
06-11-2014, 10:30 AM
orderclosetime=OrderCloseTime();
rightnow=Year()+”-”+Month()+”-”+Day()+” “+Hour()+”:”+Minute()+”:”+Seconds();
rightnow2=StrToTime(rightnow);
difference=rightnow2-orderclosetime;
if(difference < 5*60 && OrderProfit() >=100*Point && OrdersTotal()==0)
if (OrderType() == OP_SELL)

aurora
06-12-2014, 04:53 AM
1.Download/Copy/Save the MQ4/EX4 file into your C:\Program Files\MetaTrader 4\experts\indicators folder (or change the folder to your installation sometimes forex broker name)
2.Restart your MetaTrader 4 application (assuming it’s currently open) … or Launch your MetaTrader 4 application
3.On the left hand side, look for the “Navigator” window and under the “Common” tab, look into the “Custom Indicators” section
4.Locate the indicator which you have just downloaded into the folder stated in Step 1
5.Drag (Click and drag) the indicator onto the chart
6.Choose your settings and click OK.
7.NOW and your done!

aurora
06-12-2014, 04:54 PM
Array function part-1

int ArrayMinimum(
const void& array[], // array for search
int start=0, // index to start checking with
int count=WHOLE_ARRAY // number of checked elements
);

aurora
06-13-2014, 12:35 PM
The basic data types are:

•integers (char, short, int, long, uchar, ushort, uint, ulong);
•logical (bool);
•literals (ushort);
•strings (string);
•floating-point numbers (double, float);
•color (color);
•date and time (datetime);
•enumerations (enum).
Complex data types are:

•structures;
•classes.

aurora
06-13-2014, 05:41 PM
#property description "The indicator displays larger timeframe's candlesticks on the current one."
//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 16
#property indicator_plots 8
//---- plot 1
#property indicator_label1 "BearBody"
#property indicator_color1 clrSeaGreen,clrSeaGreen
//---- plot 2
#property indicator_label2 "BearBodyEnd"
#property indicator_color2 clrSeaGreen,clrSeaGreen
//---- plot 3
#property indicator_label3 "BearShadow"
#property indicator_color3 clrSalmon,clrSalmon
//---- plot 4
#property indicator_label4 "BearShadowEnd"
#property indicator_color4 clrSalmon,clrSalmon
//---- plot 5
#property indicator_label5 "BullBody"
#property indicator_color5 clrOlive,clrOlive
//---- plot 6
#property indicator_label6 "BullBodyEnd"
#property indicator_color6 clrOlive,clrOlive
//---- plot 7
#property indicator_label7 "BullShadow"
#property indicator_color7 clrSkyBlue,clrSkyBlue
//---- plot 8
#property indicator_label8 "BullShadowEnd"
#property indicator_color8 clrSkyBlue,clrSkyBlue
//--- predefined constant
#define INDICATOR_EMPTY_VALUE 0.0
//--- input parameters

aurora
06-14-2014, 04:21 PM
Profit Info part-1

#define OP_ALL 10
#define OP_OPENED 11
#define OP_PENDING 12

#property copyright "Copyright © 2014, Matus German www.MTexperts.net"
#property link "http://www.mtexperts.net"

#property indicator_separate_window
#property strict

extern string MNdescription = "ALL = all magic numbers; 0 = manual trades; 1,5846,214 = 3 selected magics";
extern string MagicNumber = "ALL";
extern string SymbolDescription = "ALL = all symbols; EURUSD,USDJPY,GBPUSD = 3 selected symbols";
extern string Symbols = "EURUSD,GBPUSD";
extern bool SortBySymbols = true;
extern color Clr_1 = White;
extern color Clr_2 = Green;
extern color Clr_3 = Red;
extern string Font ="Arial";
extern int FontSize =12;
extern int Correction = 7;

string IndicatorName = "ProfitInfo"+"_"+IntegerToString(SortBySymbols)+"_"+MagicNumber+"_"+Symbols;

//int columns;
int mNumbers[];
string sSymbols[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName(IndicatorName);
return(0);
}

aurora
06-14-2014, 06:22 PM
ADX part-1

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
//----
extern int ADXPeriod = 13;
//----
double ExtBuffer1[];
double ExtBuffer2[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0, ExtBuffer1);
SetIndexStyle(0, DRAW_HISTOGRAM, 0, 2);
//----
SetIndexBuffer(1, ExtBuffer2);
SetIndexStyle(1, DRAW_HISTOGRAM, 0, 2);
//----
IndicatorShortName("Advanced_ADX (" + ADXPeriod + ")");
return(0);
}

aurora
06-15-2014, 01:39 PM
ADX part-2

//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i, limit;
double ADX0,ADX1,ADX2;
int counted_bars = IndicatorCounted();
if(counted_bars < 0)
return(-1);
if(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars;
//----
for(i = 0; i < limit ; i++)
{
ADX0 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_MAIN, i);
ADX1 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_PLUSDI, i);
ADX2 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_MINUSDI, i);
//----
if(ADX1 >= ADX2)
{
ExtBuffer1[i] = ADX0;
ExtBuffer2[i] = 0;
}
else
{
ExtBuffer1[i] = 0;
ExtBuffer2[i] = ADX0;
}
}
return(0);
}
//+------------------------------------------------------------------+

aurora
06-15-2014, 04:16 PM
i-A indicator

#property copyright "©aurora007"
#property link

#define major 1
#define minor 0

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Gold

extern int MA_Period=25;

double MABuf[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void init()
{
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
SetIndexDrawBegin(0,MA_Period);
SetIndexBuffer(0,MABuf);

IndicatorShortName("AMMA ("+MA_Period+")");
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
void deinit()
{
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
void start()
{
int counted_bars=IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
if(counted_bars==0) limit-=1+1;

for(int i=limit; i>=0; i--)
{
if(i==Bars-1)
MABuf[i]=Close[i];
else
MABuf[i]=((MA_Period-1)*MABuf[i+1]+Close[i])/MA_Period;
}
}
//+------------------------------------------------------------------+

aurora
06-16-2014, 10:05 AM
camrila level pips

#property copyright "aurora"
#property link

#property indicator_chart_window

#property indicator_buffers 9

// Establish the Colors for the Pivot lines

// Color1 is for the Pivot Point Line
#property indicator_color1 Yellow

// Colors 1 through 4 are for the Resistance Lines
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Red

// Colors 5 through 9 are for the Support Lines
#property indicator_color6 Aqua
#property indicator_color7 Aqua
#property indicator_color8 Aqua
#property indicator_color9 Aqua


// Set Buffers

double Resistance4[],
Resistance3[],
Resistance2[],
Resistance1[],

PivotPoint[],

Support1[],
Support2[],
Support3[],
Support4[];

double range;
/*
string Res4,
Res3,
Res2,
Res1,

Pivot,

Sup1,
Sup2,
Sup3,
Sup4;
*/
int WhichWindow=0,
WhatTime=0,
WhatPrice=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+

int init()
{

aurora
06-16-2014, 01:47 PM
// Set up the Pivot Lines
// Resistance Lines

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(1,Resistance4);
SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(2,Resistance3);
SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(3,Resistance2);
SetIndexStyle(4,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(4,Resistance1);

// Camarilla Pivot Point Line

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
SetIndexBuffer(0,PivotPoint);

// Support Lines

SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(5,Support1);
SetIndexStyle(6,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(6,Support2);
SetIndexStyle(7,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(7,Support3);
SetIndexStyle(8,DRAW_LINE,STYLE_SOLID,1);
SetIndexBuffer(8,Support4);

return(0);
}

//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+

int deinit()
{

ObjectsRedraw();

return(0);
}

aurora
06-16-2014, 04:01 PM
//+------------------------------------------------------------------+
//| Camarilla Level Indicator Iteration Function |
//+------------------------------------------------------------------+

int start()
{
// Declare the variables to be used in getting the valuse for the lines

int change_day_hour=0,
counted_bars=IndicatorCounted(),
number_of_bars_to_use = Bars - counted_bars,
cnt=720;

double yesterday_high,
yesterday_low,
yesterday_close;

// Find out if there are enough Bars to perform a calculation
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;

// Bars in an internal value for the Number of bars in the current chart.

//----
for(int i=number_of_bars_to_use; i>=0; i--)
{


if (
// Check to see if this record is the 1st of the day
// then set the valuse for yesterday.

TimeHour(Time[i]) == change_day_hour &&
TimeMinute(Time[i]) == 0
)

{
// Calculate yesterday's High, Low and Close

yesterday_close= Close[i + 1];
yesterday_high = iHigh(Symbol(),PERIOD_D1,1);
yesterday_low = iLow(Symbol(),PERIOD_D1,1);
range = yesterday_high - yesterday_low;

} // if

//Comment(" ");
/*Comment("Current bar for ", Symbol(), "Open : ", iOpen(Symbol(),PERIOD_D1,1),", High : ",
iHigh(Symbol(),PERIOD_D1,1),", Low : ", iLow(Symbol(),PERIOD_D1,1),", Close : ",
iClose(Symbol(),PERIOD_D1,1),", ", iVolume(Symbol(),PERIOD_D1,1));*/




//----- Standard Pivot Calculation =====> NOT USED <=====
//----- P[] = (yesterday_high + yesterday_low + yesterday_close)/3;

Resistance4[i] = yesterday_close + (range * 1.1 / 2);
Resistance3[i] = yesterday_close + (range * 1.1 / 4);
Resistance2[i] = yesterday_close + (range * 1.1 / 6);
Resistance1[i] = yesterday_close + (range * 1.1 / 12);

Support1[i] = yesterday_close - (range * 1.1 / 12);
Support2[i] = yesterday_close - (range * 1.1 / 6);
Support3[i] = yesterday_close - (range * 1.1 / 4);
Support4[i] = yesterday_close - (range * 1.1 / 2);

//----- My Carmarilla Pivot Calculation =====> USED <=====

PivotPoint[i] = (Resistance1[i] + Support1[i]) / 2;

} // if

return(0);

} // start()
//+------------------------------------------------------------------+

aurora
06-18-2014, 09:52 AM
Step Up and Down part-1

#property copyright aurora
#property link
#property description "Price Direction movement Step Up and Down Forex Indicator"
//---
//--- indicator parameters
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 clrRed
#property indicator_width1 1
//--
extern string PriceDirection="Copyright © 2014 3RJ ~ Roy Philips-Jacobs";
//-- indicator buffer
double ma20c[];
//--
void EventSetTimer();
string symbol;
string CR;
//---
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void OnInit(void)
{
//--
symbol=_Symbol;

//----
IndicatorBuffers(1);
//--- 1 indicator buffers mapping
SetIndexBuffer(0,ma20c);
//--- indicator line drawing
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,EMPTY,clrRed);
//--- name for DataWindow and indicator subwindow label
SetIndexLabel(0,"BuySellLimit");
//--
IndicatorShortName("StepUpDown");
IndicatorDigits(Digits);
//--
//--- initialization done
return;
}

aurora
06-18-2014, 11:41 AM
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//----
EventKillTimer();
GlobalVariablesDeleteAll();
//--
ObjectDelete("DirBUY");
ObjectDelete("DirSELL");
ObjectDelete("DirBUYArr");
ObjectDelete("DirSELLArr");
//----
return;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
//---
int OnCalculate (const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
//------
if (PriceDirection!=CR) return(0);
//--
ResetLastError();
int i;
int per=7;
WindowRedraw();
Sleep(500);
RefreshRates();
int pos=WindowFirstVisibleBar();
//--
double His[],Los[];
bool dirBuy,dirSell;
//--
ArraySetAsSeries(His,true);
ArraySetAsSeries(Los,true);
//----
RefreshRates();
//--
for(i=0; i<pos; i++)
{
//--
ma20c[i]=iMA(symbol,0,20,0,MODE_SMMA,PRICE_MEDIAN,i);
//--
int posH=iHighest(symbol,0,MODE_HIGH,per,i);
int posL=iLowest(symbol,0,MODE_LOW,per,i);
if((posH>posL)&&(iLow(symbol,0,i)>=iLow(symbol,0,posL))) {dirBuy=TRUE; dirSell=FALSE;}
if((posH>posL)&&(iLow(symbol,0,i)<=iLow(symbol,0,posL))) {dirSell=TRUE; dirBuy=FALSE;}
if((posH<posL)&&(iHigh(symbol,0,i)<=iHigh(symbol,0,posH))) {dirSell=TRUE; dirBuy=FALSE;}
if((posH<posL)&&(iHigh(symbol,0,i)>=iHigh(symbol,0,posH))) {dirBuy=TRUE; dirSell=FALSE;}
//--
//--
if(i==0)
{
//---
ObjectDelete("DirBUY");
ObjectDelete("DirSELL");
ObjectDelete("DirBUYArr");
ObjectDelete("DirSELLArr");
//--
if(dirBuy) // Buy direction
{
if(ObjectFind(0,"DirBUY")<0)
{
ObjectCreate(0,"DirBUY",OBJ_TEXT,0,Time[posL],Low[posL]);
ObjectSetString(0,"DirBUY",OBJPROP_TEXT,StringConcatenate(" BUY"));
ObjectSetInteger(0,"DirBUY",OBJPROP_COLOR,clrAquamarine);
ObjectSetString(0,"DirBUY",OBJPROP_FONT,"Bodoni MT Black");
ObjectSetInteger(0,"DirBUY",OBJPROP_FONTSIZE,9);
ObjectSetInteger(0,"DirBUY",OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER);
//--
ObjectCreate(0,"DirBUYArr",OBJ_TEXT,0,Time[posL-1],Low[posL]);
ObjectSetString(0,"DirBUYArr",OBJPROP_TEXT,CharToStr(217));
ObjectSetInteger(0,"DirBUYArr",OBJPROP_COLOR,clrAquamarine);
ObjectSetString(0,"DirBUYArr",OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"DirBUYArr",OBJPROP_FONTSIZE,15);
ObjectSetInteger(0,"DirBUYArr",OBJPROP_ANCHOR,ANCHOR_RIGHT_UPPER);
}
else
{
ObjectSetString(0,"DirBUY",OBJPROP_TEXT,StringConcatenate(" BUY"));
ObjectSetInteger(0,"DirBUY",OBJPROP_COLOR,clrAquamarine);
ObjectSetString(0,"DirBUY",OBJPROP_FONT,"Bodoni MT Black");
ObjectSetInteger(0,"DirBUY",OBJPROP_FONTSIZE,9);
ObjectSetInteger(0,"DirBUY",OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER);
//--
ObjectSetString(0,"DirBUYArr",OBJPROP_TEXT,CharToStr(217));
ObjectSetInteger(0,"DirBUYArr",OBJPROP_COLOR,clrAquamarine);
ObjectSetString(0,"DirBUYArr",OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"DirBUYArr",OBJPROP_FONTSIZE,15);
ObjectSetInteger(0,"DirBUYArr",OBJPROP_ANCHOR,ANCHOR_RIGHT_UPPER);
}
//--
ChartRedraw(0);
WindowRedraw();
Sleep(1000);
RefreshRates();
//--
}
//---

aurora
06-20-2014, 11:15 AM
-=-

if(dirSell) // Sell direction
{
if(ObjectFind(0,"DirSELL")<0)
{
ObjectCreate(0,"DirSELL",OBJ_TEXT,0,Time[posH],High[posH]);
ObjectSetString(0,"DirSELL",OBJPROP_TEXT,StringConcatenate(" SELL"));
ObjectSetInteger(0,"DirSELL",OBJPROP_COLOR,clrSnow);
ObjectSetString(0,"DirSELL",OBJPROP_FONT,"Bodoni MT Black");
ObjectSetInteger(0,"DirSELL",OBJPROP_FONTSIZE,9);
ObjectSetInteger(0,"DirSELL",OBJPROP_ANCHOR,ANCHOR_LEFT_LOWER);
//--
ObjectCreate(0,"DirSELLArr",OBJ_TEXT,0,Time[posH-1],High[posH]);
ObjectSetString(0,"DirSELLArr",OBJPROP_TEXT,CharToStr(218));
ObjectSetInteger(0,"DirSELLArr",OBJPROP_COLOR,clrSnow);
ObjectSetString(0,"DirSELLArr",OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"DirSELLArr",OBJPROP_FONTSIZE,15);
ObjectSetInteger(0,"DirSELLArr",OBJPROP_ANCHOR,ANCHOR_RIGHT_LOWER);
}
else
{
ObjectSetString(0,"DirSELL",OBJPROP_TEXT,StringConcatenate(" SELL"));
ObjectSetInteger(0,"DirSELL",OBJPROP_COLOR,clrSnow);
ObjectSetString(0,"DirSELL",OBJPROP_FONT,"Bodoni MT Black");
ObjectSetInteger(0,"DirSELL",OBJPROP_FONTSIZE,9);
ObjectSetInteger(0,"DirSELL",OBJPROP_ANCHOR,ANCHOR_LEFT_LOWER);
//--
ObjectSetString(0,"DirSELLArr",OBJPROP_TEXT,CharToStr(218));
ObjectSetInteger(0,"DirSELLArr",OBJPROP_COLOR,clrSnow);
ObjectSetString(0,"DirSELLArr",OBJPROP_FONT,"Wingdings");
ObjectSetInteger(0,"DirSELLArr",OBJPROP_FONTSIZE,15);
ObjectSetInteger(0,"DirSELLArr",OBJPROP_ANCHOR,ANCHOR_RIGHT_LOWER);
}
//--
ChartRedraw(0);
WindowRedraw();
Sleep(1000);
RefreshRates();
//--
}
//--- end if(i)
}
//-- end for(i)
}
//----- done
return(rates_total);
}
//-----
//+------------------------------------------------------------------+

aurora
06-20-2014, 01:46 PM
DII part-1

#property copyright "Aurora"
#property link
#property version "1.00"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_plots 3

//--- plot Curta
#property indicator_label1 "Curta"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrLime
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- plot Media
#property indicator_label2 "Media"
#property indicator_type2 DRAW_LINE
#property indicator_color2 clrWhite
#property indicator_style2 STYLE_SOLID
#property indicator_width2 1
//--- plot Longa
#property indicator_label3 "Longa"
#property indicator_type3 DRAW_LINE
#property indicator_color3 clrYellow
#property indicator_style3 STYLE_SOLID
#property indicator_width3 1
//--- input parameters
extern int Curta=3;
extern ENUM_APPLIED_PRICE CurtaAppliedPrice = PRICE_CLOSE;
extern ENUM_MA_METHOD CurtaMethod = MODE_SMA;

extern int Media=8;
extern ENUM_APPLIED_PRICE MediaAppliedPrice = PRICE_CLOSE;
extern ENUM_MA_METHOD MediaMethod = MODE_SMA;

extern int Longa=20;
extern ENUM_APPLIED_PRICE LongaAppliedPrice = PRICE_CLOSE;
extern ENUM_MA_METHOD LongaMethod = MODE_SMA;