Re: Convert MT4 indicators to MT5

312
mrtools wrote: Thu Dec 14, 2023 7:57 am Would need the non-decompiled version.
PLEASE CAN YOU USE THIS?

Code: Select all

//Sample Code
//===========================================================================================//=================TITLE================================================================================================
_SECTION_BEGIN("Price Ploting");

pricestyle=ParamToggle("Price style","Bar|Candle",1);
if (pricestyle == 1)
{
Candlefill = IIf(C>=Ref(C,-1),ParamColor("Green candle",colorGreen),ParamColor("red candle",colorRed) );
SetBarFillColor (Candlefill);
PlotOHLC( Open, High, Low, Close, "", Candlefill, styleCandle,maskPrice);
}
if (pricestyle == 0)
{
Candlefill = IIf(C>=Ref(C,-1),ParamColor("Green candle",colorLime),ParamColor("red candle",colorRed) );
PlotOHLC( Open, High, Low, Close, "", Candlefill, styleBar,maskPrice);
}

pbfak= Param("Pin Bar Factor",3,0,100,0.25);
CR = abs(H-L);
CB = abs(O-C);
Candlecheck = IIf((CR >=(pbfak*CB)),1,0);
SetBarFillColor (IIf(Candlecheck ==1,candlefill,colorBlack));
PlotOHLC( Open, High, Low, Close, "", IIf(Candlecheck ==1,Candlefill,colorBlack), styleCandle,maskPrice);

_SECTION_END();
//=================TITLE================================================================================================
//=========================================================================================
_SECTION_BEGIN("Swing Signal System");
DayH = TimeFrameGetPrice("H", inDaily, -1); DayHI = LastValue (DayH,1);// yesterdays high
DayL = TimeFrameGetPrice("L", inDaily, -1); DayLI = LastValue (DayL,1); // yesterdays low
DayC = TimeFrameGetPrice("C", inDaily, -1); // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily); // current day open
numbars = LastValue(Cum(Status("barvisible")));
hts = -33.5;
YHL = ParamToggle("Yesterday HI LO","Show|Hide",1);
if(YHL==1) {
// Plot(DayL,"YL",colorTurquoise,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
// Plot(DayH,"YH",colorTurquoise,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
//PlotText(" YH " , LastValue(BarIndex())-(numbars/Hts), DayHI, colorTurquoise);
//PlotText(" YL " , LastValue(BarIndex())-(numbars/Hts), DayLI, colorTurquoise);
DayLcolor= IIf(C>= DayO,colorDarkOliveGreen,colorViolet);
Plot(DayC ,"YC",colorIndigo,styleDots|styleNoLine|styleNoRescale|styleNoTitle);
Offset = 20;
//Plot(LineArray(BarCount, DayC , BarCount+20, DayC ,0), "", colorRed, styleLine|styleDots, Null, Null, 20);
Plot(DayO ,"YO",DayLcolor,styleDots|styleNoLine|styleNoRescale|styleNoTitle);



///////////////////////////////////////////////////////////////////////////////

messageboard = ParamToggle("Message Board","Show|Hide",0);
showsl = ParamToggle("Stop Loss Line", "Show|Hide", 0);
no=10;
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C1;i--)

{
if(Buy == 1)
{
entry = C;
sig = "BUY";
sl = s5d;
tar1 = DayC1 ;
tar2 = entry + (entry * .0092);
tar3 = entry + (entry * .0179);

bars = i;
i = 0;
}
if(Sell == 1)
{
sig = "SELL";
entry = C;
sl = s5d;
tar1 = DayC1;
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);


bars = i;
i = 0;
}
}
*/

for(i=BarCount-1;i>1;i--)

{

//tar1 = DayC1;
bars = i;
i = 0;

}




for(i = 1; i < BarCount; i++)
{
tar2 = DayO1;
tar1 = DayC;
Clro = IIf(C>=tar1,colorLime,colorRed);
}

Offset = 20;
Clr = colorBlueGrey;
//Clro = IIf(C>=tar2,colorLime,colorRed);
Plot(LineArray(bars-Offset, tar1, BarCount-20, tar1,1), "", colorIndigo, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar2 , BarCount+20, tar2 ,1), "", Clr, styleLine|styleDots, Null, Null, Offset);
}
_SECTION_END();
//=========================================================================================


Re: Convert MT4 indicators to MT5

320
¹mohamadkamali wrote: Tue Jan 02, 2024 2:47 pm Hello, can you help to convert the indicators to mql5 so that it works in MetaTrader 5? Thank you in advance for your help.
This is the nonlag ma dot version.

ps) the happs phases and givonly indicators are both decompiled and doubt anyone will convert those.
These users thanked the author mrtools for the post (total 3):
太虚一毫, kvak, RodrigoRT7


Who is online

Users browsing this forum: PaperLi [Bot] and 4 guests