Focus on the higher timeframe. Learn to distinguish whem market is trending or ranging. And don't oversize your trade. Any technical system just pick one (many available) and don't switch too often.
NEWBIE >> COMPUTE ANGLE FOR TRENDING. YOU WILL FIND ITs ADVANTAGE BUT THE ANGLE VARIABLE OF CHART CONSTANTLY CHANGE AT MT4/MT5. MT4/MT5 SOFTWARE IS VERY SMART.
Attached strategy >> **Increasing angle increase lot size
**This is only personal suggestion, trade at your own risk.
//+------------------------------------------------------------------+//| Angle_Tool.mq4 |//| TAN EK KUN |//| |//+------------------------------------------------------------------+#property copyright"TAN EK KUN"#property link""#property version"1.00"#property strict#property strict//--- description#property description"Script draws \"Trend Line By Angle\" graphical object."#property description"Anchor point coordinates are set in percentage of the size of"#property description"the chart window."//--- display window of the input parameters during the script's launch#property script_show_inputs//--- input parameters of the scriptinputstring InpName="Trend"; // Line nameinputint InpDate1=100; // 1 st point's date, %inputint InpPrice1=95; // 1 st point's price, %inputint InpAngle=0; // Line's slope angleinputcolor InpColor=clrRed; // Line colorinputENUM_LINE_STYLE InpStyle=STYLE_DASH; // Line styleinputint InpWidth=1; // Line widthinputbool InpBack=false; // Background lineinputbool InpSelection=true; // Highlight to moveinputbool InpRayRight=true; // Line's continuation to the rightinputbool InpHidden=true; // Hidden in the object listinputlong InpZOrder=0; // Priority for mouse clickstring symbol="GBPCHF+";
string LLS_Period="PERIOD_H1";
//+------------------------------------------------------------------+//| Create a trend line by angle |//+------------------------------------------------------------------+bool TrendByAngleCreate(constlong chart_ID=0, // chart's IDconststring name="TrendLine", // line nameconstint sub_window=0, // subwindow indexdatetime time=0, // point timedouble price=0, // point pricedatetime time2=0, // point time2double price2=0, // point price2constdouble angle=45.0, // slope angleconstcolor clr=clrRed, // line colorconstENUM_LINE_STYLE style=STYLE_SOLID, // line styleconstint width=1, // line widthconstbool back=false, // in the backgroundconstbool selection=true, // highlight to moveconstbool ray_right=true, // line's continuation to the rightconstbool hidden=true, // hidden in the object listconstlong z_order=0) // priority for mouse click
{
//--- create the second point to facilitate dragging the trend line by mouse//datetime time2=0;//double price2=0;//--- set anchor points' coordinates if they are not set//ChangeTrendEmptyPoints(time,price,time2,price2);//--- reset the error valueResetLastError();
//--- create a trend line using 2 pointsif(!ObjectCreate(chart_ID,name,OBJ_TRENDBYANGLE,sub_window,time,price,time2,price2))
{
Print(__FUNCTION__,
": failed to create a trend line! Error code = ",GetLastError());
return(false);
}
//--- change trend line's slope angle; when changing the angle, coordinates of the second//--- point of the line are redefined automatically according to the angle's new value//ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,angle);//--- set line colorObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- set line styleObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
//--- set line widthObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);
//--- display in the foreground (false) or background (true)ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- enable (true) or disable (false) the mode of moving the line by mouse//--- when creating a graphical object using ObjectCreate function, the object cannot be//--- highlighted and moved by default. Inside this method, selection parameter//--- is true by default making it possible to highlight and move the objectObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- enable (true) or disable (false) the mode of continuation of the line's display to the rightObjectSetInteger(chart_ID,name,OBJPROP_RAY_RIGHT,ray_right);
//--- hide (true) or display (false) graphical object name in the object listObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- set the priority for receiving the event of a mouse click in the chartObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- successful executionreturn(true);
}
//+------------------------------------------------------------------+//| Delete the trend line |//+------------------------------------------------------------------+bool TrendDelete(constlong chart_ID=0, // chart's IDconststring name="TrendLine") // line name
{
//--- reset the error valueResetLastError();
//--- delete a trend lineif(!ObjectDelete(chart_ID,name))
{
Print(__FUNCTION__,
": failed to delete a trend line! Error code = ",GetLastError());
return(false);
}
//--- successful executionreturn(true);
}
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
long a = ChartOpen(symbol,LLS_Period);
//--- number of visible bars in the chart windowint bars2=(int)ChartGetInteger(a,CHART_VISIBLE_BARS);
//--- price array sizeint accuracy2=1000;
//--- arrays for storing the date and price values to be used//--- for setting and changing line anchor points' coordinatesdatetime date2[];
//--- memory allocationArrayResize(date2,bars2);
//--- fill the array of datesResetLastError();
if(CopyTime(ChartSymbol(a),LLS_Period,0,bars2,date2)==-1)
{
Print("Failed to copy time values! Error code = ",GetLastError());
return;
}
//--- define points for drawing the lineint d1=InpDate1*(bars2-1)/100;
//Alert(date2[0]); //--- create a trend line//if(!TrendByAngleCreate(0,InpName,0,date[d1],price[p1],InpAngle,InpColor,InpStyle,if(!TrendByAngleCreate(a,InpName,0,date2[d1],MarketInfo(Symbol(),MODE_ASK),iTime(Symbol(),Period(),200),iClose(Symbol(),Period(),200),InpAngle,InpColor,InpStyle,
InpWidth,InpBack,InpSelection,InpRayRight,InpHidden,InpZOrder))
{
return;
}
//--- redraw the chart and wait for 1 second//ChartRedraw();Sleep(1000);
if (ObjectGetDouble(a,InpName,OBJPROP_ANGLE,0) < 180)
{
double delta= (180-ObjectGetDouble(a,InpName,OBJPROP_ANGLE,0))*-1;
Alert(symbol+":downtrend");
Alert(delta);
Alert("Ori:"+ObjectGetDouble(a,InpName,OBJPROP_ANGLE,0));
}
if (ObjectGetDouble(a,InpName,OBJPROP_ANGLE,0) > 180)
{
double delta= ObjectGetDouble(a,InpName,OBJPROP_ANGLE,0)-180;
Alert(symbol+":uptrend");
Alert(delta);
Alert("Ori:"+ObjectGetDouble(a,InpName,OBJPROP_ANGLE,0));
}
//--- 1 second of delaySleep(1000);
//--- delete from the chart//TrendDelete(0,InpName);//ChartRedraw();//--- 1 second of delaySleep(1000);
//---
}
NEWBIE >> COMPUTE ANGLE FOR TRENDING. YOU WILL FIND ITs ADVANTAGE BUT THE ANGLE VARIABLE OF CHART CONSTANTLY CHANGE AT MT4/MT5. MT4/MT5 SOFTWARE IS VERY SMART.
Attached strategy >> **Increasing angle increase lot size
**This is only personal suggestion, trade at your own risk.
NEWBIE >> COMPUTE ANGLE FOR TRENDING. YOU WILL FIND ITs ADVANTAGE BUT THE ANGLE VARIABLE OF CHART CONSTANTLY CHANGE AT MT4/MT5. MT4/MT5 SOFTWARE IS VERY SMART.
Attached strategy >> **Increasing angle increase lot size
**This is only personal suggestion, trade at your own risk.
Hi, as I'm a beginner, can you explain how to put this strategy into MT5? How to set it? Thanks
Study market structure and enter when price is at a discount relative to structure. With this and good money management (cut losers short , let winners run, dont let winners become losers), you will do very well.
Multi timeframe analysis is one of the many best strategies out there. Basically it's just going to the monthly timeframe down to the M15 timeframe for Analysis
correlation between all available instruments with historically strong correlation. For example WTI and Brent, DE30 and F40. determines levels of correlation and automatically at the same time sells strong instruments and buys weak instruments when the correlation between them weakens or diverges beyond a pre-defined level. Once mean reversion (or by opposite signal -pre-defined ) takes place the locked position created by the two orders: buy and sell, must be generally be in profit.
algo900 #: correlation between all available instruments with historically strong correlation. For example WTI and Brent, DE30 and F40. determines levels of correlation and automatically at the same time sells strong instruments and buys weak instruments when the correlation between them weakens or diverges beyond a pre-defined level. Once mean reversion (or by opposite signal -pre-defined ) takes place the locked position created by the two orders: buy and sell, must be generally be in profit.
How would you know when if they will correlate or not.. I dont really understand how you use correlation.
I suppose that for example if WTI and Brent correlate, if WTI goes up. Brent will follow and you will buy Brent? Like this should we use correlation?
How would you know when if they will correlate or not.. I dont really understand how you use correlation.
I suppose that for example if WTI and Brent correlate, if WTI goes up. Brent will follow and you will buy Brent? Like this should we use correlation? , let's say in a period of 50 candle the correlation between them is 98% so during the next 50 candle if the correlation became 70% as example you can buy the weaker one in volatility and sell the strongest in the volatility becasue with the mean reversion theory they will back to 98% correlation again and when this happened the net result between the tow trades will be positive.
let's say in a period of 50 candle the correlation between them is 98% so during the next 50 candle if the correlation became 70% as example you can buy the weaker one in volatility and sell the strongest in the volatility becasue with the mean reversion theory they will back to 98% correlation again and when this happened the net result between the tow trades will be positive.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Focus on the higher timeframe. Learn to distinguish whem market is trending or ranging. And don't oversize your trade. Any technical system just pick one (many available) and don't switch too often.
apreciated bang
thanks
NEWBIE >> COMPUTE ANGLE FOR TRENDING. YOU WILL FIND ITs ADVANTAGE BUT THE ANGLE VARIABLE OF CHART CONSTANTLY CHANGE AT MT4/MT5. MT4/MT5 SOFTWARE IS VERY SMART.
Attached strategy >> **Increasing angle increase lot size
**This is only personal suggestion, trade at your own risk.
NEWBIE >> COMPUTE ANGLE FOR TRENDING. YOU WILL FIND ITs ADVANTAGE BUT THE ANGLE VARIABLE OF CHART CONSTANTLY CHANGE AT MT4/MT5. MT4/MT5 SOFTWARE IS VERY SMART.
Attached strategy >> **Increasing angle increase lot size
**This is only personal suggestion, trade at your own risk.
nice ***
apreciated
NEWBIE >> COMPUTE ANGLE FOR TRENDING. YOU WILL FIND ITs ADVANTAGE BUT THE ANGLE VARIABLE OF CHART CONSTANTLY CHANGE AT MT4/MT5. MT4/MT5 SOFTWARE IS VERY SMART.
Attached strategy >> **Increasing angle increase lot size
**This is only personal suggestion, trade at your own risk.
Hi, as I'm a beginner, can you explain how to put this strategy into MT5? How to set it? Thanks
correlation between all available instruments with historically strong correlation. For example WTI and Brent, DE30 and F40. determines levels of correlation and automatically at the same time sells strong instruments and buys weak instruments when the correlation between them weakens or diverges beyond a pre-defined level. Once mean reversion (or by opposite signal -pre-defined ) takes place the locked position created by the two orders: buy and sell, must be generally be in profit.
How would you know when if they will correlate or not.. I dont really understand how you use correlation.
I suppose that for example if WTI and Brent correlate, if WTI goes up. Brent will follow and you will buy Brent? Like this should we use correlation?
How would you know when if they will correlate or not.. I dont really understand how you use correlation.
I suppose that for example if WTI and Brent correlate, if WTI goes up. Brent will follow and you will buy Brent? Like this should we use correlation? , let's say in a period of 50 candle the correlation between them is 98% so during the next 50 candle if the correlation became 70% as example you can buy the weaker one in volatility and sell the strongest in the volatility becasue with the mean reversion theory they will back to 98% correlation again and when this happened the net result between the tow trades will be positive.