قديم 28-04-2017, 07:36 PM
  المشاركه #1

عضو هوامير المميز

تاريخ التسجيل: Sep 2006
المشاركات: 3,104
majed2005 غير متواجد حالياً  

السلام عليكم ورحمة الله وبركاته
هل يوجد معادلة للايمي بروكر لختراق المقاومات
جزاكم الله خير

الموضوع الأصلي : اضغط هنا    ||   المصدر : منتدى هوامير البورصة السعودية


رد مع اقتباس
 
 

قديم 04-05-2017, 07:59 PM
  المشاركه #2

عضو هوامير المميز

تاريخ التسجيل: Jul 2006
المشاركات: 520
abufaris99 غير متواجد حالياً  

تفضل

دعم ومقاومة


_SECTION_BEGIN("Automatic support and resistance");
// define reusable function
function SupResLevels( bars, colorUp, ColorDn )
{
bi = BarIndex();
lvbi = LastValue( bi );

// return HHV value only for bars starting from the bar where HHV level was established
hv = IIf( bi >= lvbi - LastValue( HHVBars( High, bars ) ), LastValue( HHV( High, bars ) ), Null );

// the same approach for LLV
lv = IIf( bi >= lvbi - LastValue( LLVBars( Low, bars ) ), LastValue( LLV( Low, bars ) ), Null );

// plot levels
Plot( hv, "hv", colorUp, styleDashed );
Plot( lv, "lv", ColorDn, styleDashed );
}

// price plot
Plot( Close, "Close", colorDefault, styleBar );

// call function with various parameters
SupResLevels( 10, colorGreen, colorRed );
SupResLevels( 20, colorGreen, colorRed );
SupResLevels( 30, colorGreen, colorRed );
SupResLevels( 40, colorGreen, colorRed );
SupResLevels( 50, colorGreen, colorRed );
_SECTION_END();



وايضا معادله جميله للمناطق الطلب والعرض

_SECTION_BEGIN("demand and supply");
SetChartOptions(0,chartShowArrows|chartShowDates);
bk=ParamColor( "Bk col",colorDarkGrey);
SetChartBkColor(bk);
SetBarFillColor(IIf(C>O,colorBrightGreen,IIf(C<=O,colorRed,colorLightGrey)));
Plot(C," | Demand & supply |\nPrice",47,64,0,0,0,0);

sr=ParamToggle("Plot Supp/Res lines","No|Yes" ,1);
Per=Param("Sensitivity",1.5,0.5,5,0.5);
g=Param("No.of Lines",1,1,5,1);
x=Cum(1);
Pk1=PeakBars(H,per,1)== 0;
Tk1=TroughBars(L,per,1)== 0;

px1=LastValue(ValueWhen(pk1,x,1));
px2=LastValue(ValueWhen(Pk1,x,2));
px3=LastValue(ValueWhen(Pk1,x,3));
px4=LastValue(ValueWhen(pk1,x,4));
px5=LastValue(ValueWhen(Pk1,x,5));

tx1=LastValue(ValueWhen(Tk1,x,1));
tx2=LastValue(ValueWhen(Tk1,x,2));
tx3=LastValue(ValueWhen(Tk1,x,3));
tx4=LastValue(ValueWhen(Tk1,x,4));
tx5=LastValue(ValueWhen(Tk1,x,5));

XT1 =LastValue(ValueWhen(pk1,H,1));XT1c =LastValue(ValueWhen(pk1,Max(C,O),1));
XT2 =LastValue(ValueWhen(Pk1,H,2));XT2c =LastValue(ValueWhen(pk1,Max(C,O),2));
XT3 =LastValue(ValueWhen(Pk1,H,3));XT3c =LastValue(ValueWhen(pk1,Max(C,O),3));
XT4 =LastValue(ValueWhen(pk1,H,4));XT4c =LastValue(ValueWhen(pk1,Max(C,O),4));
XT5 =LastValue(ValueWhen(Pk1,H,5));XT5c =LastValue(ValueWhen(pk1,Max(C,O),5));

YT1 =LastValue(ValueWhen(tk1,L,1));YT1c =LastValue(ValueWhen(tk1,Min(O,C),1));
YT2 =LastValue(ValueWhen(tk1,L,2));YT2c =LastValue(ValueWhen(tk1,Min(O,C),2));
YT3 =LastValue(ValueWhen(tk1,L,3));YT3c =LastValue(ValueWhen(tk1,Min(O,C),3));
YT4 =LastValue(ValueWhen(tk1,L,4));YT4c =LastValue(ValueWhen(tk1,Min(O,C),4));
YT5 =LastValue(ValueWhen(tk1,L,5));YT5c =LastValue(ValueWhen(tk1,Min(O,C),5));

pk1=IIf(x>px1 AND g>=1 AND sr,XT1,Null);pk1c=IIf(x>px1 AND g>=1 AND sr,XT1c,Null);
Col1=IIf( LastValue(C)>pk1, ColorRGB(14,14,100), ColorRGB(180,20,20) );
Plot(pk1,"",31,1);PlotOHLC(0,pk1,pk1c,0,"",Col1,styleCloud|styleNoLabel,Null, Null, Null, -1);
pk2=IIf(x>px2 AND g>=2 AND sr,XT2,Null);pk2c=IIf(x>px2 AND g>=2 AND sr,XT2c,Null);
Col2=IIf( LastValue(C)>pk2, ColorRGB(24,24,120), ColorRGB(180,40,40) );
Plot(pk2,"",31,1);PlotOHLC(0,pk2,pk2c,0,"",Col2,styleCloud|styleNoLabel,Null, Null, Null, -2);
pk3=IIf(x>px3 AND g>=3 AND sr,XT3,Null);pk3c=IIf(x>px3 AND g>=3 AND sr,XT3c,Null);
Col3=IIf( LastValue(C)>pk3, ColorRGB(34,34,140),ColorRGB(180,60,60));
Plot(pk3,"",31, 1);PlotOHLC(0,pk3,pk3c,0,"",Col3,styleCloud|styleNoLabel,Null, Null, Null, -3);
pk4=IIf(x>px4 AND g>=4 AND sr,XT4,Null);pk4c=IIf(x>px4 AND g>=4 AND sr,XT4c,Null);
Col4=IIf( LastValue(C)>pk4, ColorRGB(44,44,160), ColorRGB(180,80,80));
Plot(pk4,"",31,1);PlotOHLC(0,pk4,pk4c,0,"",Col4,styleCloud|styleNoLabel,Null, Null, Null, -4);
pk5=IIf(x>px5 AND g>=5 AND sr,XT5,Null);pk5c=IIf(x>px5 AND g>=5 AND sr,XT5c,Null);
Col5=IIf( LastValue(C)>pk5, ColorRGB(54,54,180), ColorRGB(180,100,100));
Plot(pk5,"",31,1);PlotOHLC(0,pk5,pk5c,0,"",Col5,styleCloud|styleNoLabel,Null, Null, Null, -5);
tl1=IIf(x>tx1 AND g>=1 AND sr,YT1,Null);tl1c=IIf(x>tx1 AND g>=1 AND sr,YT1c,Null);
Col1=IIf( LastValue(C)>tl1, ColorRGB(14,14,100), ColorRGB(180,20,20) );
Plot(tl1,"",1,1);PlotOHLC(0,tl1,tl1c,0,"",Col1,styleCloud|styleNoLabel,Null, Null, Null, -1);
tl2=IIf(x>tx2 AND g>=2 AND sr,YT2,Null);tl2c=IIf(x>tx2 AND g>=2 AND sr,YT2c,Null);
Col2=IIf( LastValue(C)>YT2, ColorRGB(24,24,120), ColorRGB(180,40,40));
Plot(tl2,"",1,1);PlotOHLC(0,tl2,tl2c,0,"",Col2,styleCloud|styleNoLabel,Null, Null, Null, -2);
tl3=IIf(x>tx3 AND g>=3 AND sr,YT3,Null);tl3c=IIf(x>tx3 AND g>=3 AND sr,YT3c,Null);
Col3=IIf( LastValue(C)>YT3, ColorRGB(34,34,140), ColorRGB(180,60,60) );
Plot(tl3,"",1,1);PlotOHLC(0,tl3,tl3c,0,"",Col3,styleCloud|styleNoLabel,Null, Null, Null, -3);
tl4=IIf(x>tx4 AND g>=4 AND sr,YT4,Null);tl4c=IIf(x>tx4 AND g>=4 AND sr,YT4c,Null);
Col4=IIf( LastValue(C)>YT4, ColorRGB(44,44,160), ColorRGB(180,80,80) );
Plot(tl4,"",1,1);PlotOHLC(0,tl4,tl4c,0,"",Col4,styleCloud|styleNoLabel,Null, Null, Null, -4);
tl5=IIf(x>tx5 AND g>=5 AND sr,YT5,Null);tl5c=IIf(x>tx5 AND g>=5 AND sr,YT5c,Null);
Col5=IIf( LastValue(C)>YT5, ColorRGB(54,54,180), ColorRGB(180,100,100));
Plot(tl5,"",1,1);PlotOHLC(0,tl5,tl5c,0,"",Col5,styleCloud|styleNoLabel,Null, Null, Null, -5);



Filter = 1;
AddColumn(C,"Close",1,IIf(C>Ref(C,-1),colorGreen,colorRed));
AddColumn( XT1 , "XT1 ", 0 );
AddColumn( XT2 , "XT2 ", 0 );
AddColumn( YT1 , "YT1 ", 0 );
AddColumn( YT2 , " YT2 ", 0 );


_SECTION_END();



تقبل تحياتي



رد مع اقتباس
قديم 04-05-2017, 09:55 PM
  المشاركه #3

عضو هوامير المميز

تاريخ التسجيل: Jul 2008
المشاركات: 4,345
طلال الصبحي غير متواجد حالياً  

السلام عليكم
ان شاء الله تفيدكم

بها مقاومات ودعوم مع قوالب ترندات هابطه وصاعده مرسومه ومتوسطات
عباره عن حبكه وتم جمعها من موضوع اللورد معادلات المثبت



_SECTION_BEGIN("KH_PriceChart");
//-- Author : KelvinHand

bgTop = ParamColor("BgTop", colorBlack);
bgBot = ParamColor("BgBottom", colorBlack);
SetChartBkGradientFill( bgTop ,bgBot, colorLightGrey);

pStyle = ParamList("Price Style", "Candle|Solid Candle|Bar|Line|Heikin-Ashi");
cBull = ParamColor("Price Bull", colorLime);
CBear = ParamColor("Price Bear", colorRed);
cLine = ParamColor("Price Line", colorWhite);



SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

ThisStyle = styleCandle;
ThisTitle = "";

_O=O; _C=C; _H=H; _L=L;

ThisColor = IIf( _C>_O, cBull, IIf(_C<_O, CBear, CLine));


switch (pStyle )
{

case "Solid Candle":
SetBarFillColor( ThisColor );
break;


case "Bar":
ThisStyle = styleBar;
break;

case "Line":
ThisStyle = styleLine;
ThisColor = cLine;
break;


case "Heikin-Ashi":
_C = (O+H+L+C)/4;
_O = AMA( Ref( _C, -1 ), 0.5 );
_H = Max( H, Max( _C, _O ) );
_L = Min( L, Min( _C, _O ) );

ThisColor = IIf(_C >= _O,CBull, CBear);
SetBarFillColor( ThisColor );

ThisColor = IIf(_C >= _O,cLine, cLine);
ThisTitle = "Heikin-Ashi";
break;

default:
SetBarFillColor( ThisColor );
ThisColor = cLine;

break;

}


PlotOHLC( _O, _H, _L, _C, ThisTitle, ThisColor, ThisStyle);



GraphXSpace = 5;


//This Section is For HH HL LH LL //

Q = Param( "% Change", 2, 0.1, 10, 0.1 );
Z = Zig( C , q ) ;
HH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( z, q, 1 ) > Peak( Z, q, 2 ) ) );
LH = ( ( Z < Ref( Z, -1 ) AND Ref( Z, -1 ) > Ref( Z, -2 ) ) AND (Peak( Z, q, 1 ) < Peak( Z, q, 2 ) ) );
HL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) > Trough( Z, q, 2 ) ) );
LL = ( ( Z > Ref( Z, -1 ) AND Ref( Z, -1 ) < Ref( Z, -2 ) ) AND (Trough( Z, q, 1 ) < Trough( Z, q, 2 ) ) );
GraphXSpace = 5;
dist = 0.5 * ATR( 20 );

for ( i = 0; i < BarCount; i++ )
{
if ( HH[i] )
PlotText( "HH", i, H[ i ] + dist[i], colorYellow );

if ( LH[i] )
PlotText( "LH", i, H[ i ] + dist[i], colorYellow );

if ( HL[i] )
PlotText( "HL", i, L[ i ] - dist[i], colorPink );

if ( LL[i] )
PlotText( "LL", i, L[ i ] - dist[i], colorPink );

}








_SECTION_END();

_SECTION_BEGIN("MA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 500, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();





//PIVOTS
///////////

pivbuy= Ref(L,-1)<Ref(L,-2) AND L>Ref(L,-1) AND Ref(H,-1)<Ref(H,-2) AND H>Ref(H,-1) AND C>Ref(C,-2) ;
pivsell= Ref(H,-1)>Ref(H,-2) AND H<Ref(H,-1) AND Ref(L,-1)>Ref(L,-2) AND L<Ref(L,-1) AND C<Ref(C,-2) ;

Buy = pivbuy ;
Sell = pivsell ;

Buy= ExRem(Buy,Sell) ;
Sell= ExRem(Sell,Buy) ;

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0,L,Offset=-10);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,Offset=-10);
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxx

//PRICE
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +
" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C,
SelectedValue( ROC( C, 1 )));
}
_SECTION_END();
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx

//TRENDING RIBBON
// Paste the code below to your price chart somewhere and green ribbon means both
// both MACD and ADX trending up so if the red ribbon shows up the MACD and the ADX
// are both trending down.
_SECTION_BEGIN("trending ribbon");
uptrend= PDI()>MDI() AND MACD()>Signal() ;
downtrend= MDI()>PDI() AND Signal()>MACD() ;
Plot( 2, /* defines the height of the ribbon in percent of pane width */"",
IIf( uptrend AND EMA(C,50)>=Ref(EMA(C,50),-1), colorLime, IIf( downtrend OR EMA(C,50)<Ref(EMA(C,50),-1),
colorRed, colorAqua )), /* choose color */
styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx

_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/8 );
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxTextOut( IndustryID(1), Status("pxwidth")/2, Status("pxheight")/4 );

GfxSelectFont("Tahoma", Status("pxheight")/18 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "PRASAD RAO", Status("pxwidth")/2, Status("pxheight")/3 );
_SECTION_END();

SetBarFillColor( IIf(O>C,colorDarkRed, colorBrightGreen ) );
Plot( C, "Price", IIf( O>C,colorRed, colorGreen ), styleCandle );

HaClose =EMA((O+H+L+C)/4,3);
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );

_SECTION_BEGIN("Resistance");

supres=ParamToggle("Sup_Res","No|Yes",1);
if(supres)
{


Prd1=Param("Res_Period1",2,0,200,1);

test = TEMA ( High , Prd1 ) ;

PK = test > Ref(test,-1) AND Ref(test,1) < High;//Peak
PKV0 = ValueWhen(PK,haHigh,0);//PeakValue0
PKV1 = ValueWhen(PK,haHigh,1);//PeakValue1
PKV2 = ValueWhen(PK,haHigh,2);//PeakValue2

MPK = PKV2 < PKV1 AND PKV1 > PKV0 ;//MajorPeak

MPKV = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,1); //MajorPeakValue
MPKD = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),1); //MajorPeakDate
SD = IIf(DateNum() < LastValue(MPKD,lastmode = True ), Null, LastValue(MPKV,Lastmode = True));//SelectedDate
Plot(SD, "Resist1", colorBrown,ParamStyle("ResStyle1",styleLine|styleNoTitle,maskAll));

MPKV2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,2); //MajorPeakValue
MPKD2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),2); //MajorPeakDate
SD2 = IIf(DateNum() < LastValue(MPKD2,lastmode = True ), Null, LastValue(MPKV2,Lastmode = True));//SelectedDate
Plot(SD2, "Resist2", colorBrown,ParamStyle("ResStyle2",styleLine|styleNoTitle,maskAll));


MPKV3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,3); //MajorPeakValue
MPKD3 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),3); //MajorPeakDate
SD3 = IIf(DateNum() < LastValue(MPKD3,lastmode = True ), Null, LastValue(MPKV3,Lastmode = True));//SelectedDate
Plot(SD3, "Resist3", colorBrown,ParamStyle("ResStyle3",styleLine|styleNoTitle,maskAll));


MPKV4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,4); //MajorPeakValue
MPKD4 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),4); //MajorPeakDate
SD4 = IIf(DateNum() < LastValue(MPKD4,lastmode = True ), Null, LastValue(MPKV4,Lastmode = True));//SelectedDate
Plot(SD4, "Resist4", colorBrown,ParamStyle("ResStyle4",styleLine|styleNoTitle,maskAll));



MPKV5 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,5); //MajorPeakValue
MPKD5 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),5); //MajorPeakDate
SD5 = IIf(DateNum() < LastValue(MPKD5,lastmode = True ), Null, LastValue(MPKV5,Lastmode = True));//SelectedDate
Plot(SD5, "Resist5", colorBrown,ParamStyle("ResStyle5",styleLine|styleNoTitle,maskAll));


MPKV6 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,6); //MajorPeakValue
MPKD6 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),6); //MajorPeakDate
SD6 = IIf(DateNum() < LastValue(MPKD6,lastmode = True ), Null, LastValue(MPKV6,Lastmode = True));//SelectedDate
Plot(SD6, "Resist6", colorBrown ,ParamStyle("ResStyle6",styleLine|styleNoTitle,maskAll));




_SECTION_END();


_SECTION_BEGIN("Support");
//SP=L > Ref(L,-1) AND Ref(L,1) < L;//Peak

Prd2=Param("Sup_Period1",2,0,200,1);

test2 = TEMA ( Low , Prd2 ) ;

SP = Ref(test2,1) > Low AND test2 < Ref(test2,-1);//Peak
SPV0 = ValueWhen(SP,haLow,0);//PeakValue0
SPV1 = ValueWhen(SP,haLow,1);//PeakValue1
SPV2 = ValueWhen(SP,haLow,2);//PeakValue2

//PKV5 = ValueWhen(PK,haHigh,5);//PeakValue5
//PKV6 = ValueWhen(PK,haHigh,6);//PeakValue6

MSP = SPV2 > SPV1 AND SPV1 < SPV0 ;//MajorPeak

MSPV = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,1);
MSPD = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),1);
SD = IIf(DateNum() < LastValue(MSPD,lastmode = True ), Null, LastValue(MSPV,Lastmode = True));
Plot(SD,"Support1", colorPlum,ParamStyle("SupportLine1",styleLine|styleNoTitle,maskAll));



MSPV2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,2);
MSPD2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),2);
SD2 = IIf(DateNum() < LastValue(MSPD2,lastmode = True ), Null, LastValue(MSPV2,Lastmode = True));
Plot(SD2,"Support2", colorPlum,ParamStyle("SupportLine2",styleLine|styleNoTitle,maskAll));



MSPV3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,3);
MSPD3 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),3);
SD3 = IIf(DateNum() < LastValue(MSPD3,lastmode = True ), Null, LastValue(MSPV3,Lastmode = True));
Plot(SD3,"Support3", colorPlum,ParamStyle("SupportLine3",styleLine|styleNoTitle,maskAll));


MSPV4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,4);
MSPD4 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),4);
SD4 = IIf(DateNum() < LastValue(MSPD4,lastmode = True ), Null, LastValue(MSPV4,Lastmode = True));
Plot(SD4,"Support4", colorPlum,ParamStyle("SupportLine4",styleLine|styleNoTitle,maskAll));


MSPV5 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,5);
MSPD5 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),5);
SD5 = IIf(DateNum() < LastValue(MSPD5,lastmode = True ), Null, LastValue(MSPV5,Lastmode = True));
Plot(SD5,"Support5", colorPlum,ParamStyle("SupportLine5",styleLine|styleNoTitle,maskAll));


MSPV6 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,6);
MSPD6 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),6);
SD6 = IIf(DateNum() < LastValue(MSPD6,lastmode = True ), Null, LastValue(MSPV6,Lastmode = True));
Plot(SD6,"Support6", colorPlum,ParamStyle("SupportLine6",styleLine|stylehidden|styleNoTitle,maskAll ));

}

_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("EMA2");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1, 10 );
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("CandlePivots+trendline");
/////// advance trenlines with candle pivots ///////////////////
SetChartOptions(0, chartShowArrows | chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} ,{{VALUES}}", O, H, L, C, SelectedValue(ROC(C, 1))));
Plot(C, "", IIf(O >= C, colorOrange, colorGreen), styleCandle);
SetChartBkGradientFill(ParamColor("Inner panel upper", colorBlack), ParamColor("Inner panel lower", colorBlack));
_N(Title = EncodeColor(colorWhite) + StrFormat(" {{NAME}} - {{INTERVAL}} {{DATE}} Open:%g,high:%g,low:%g, Close:%g ,{{VALUES}}", O, H, L, C));
/////////////////////////////////////////////////////////////////////////////////////////////
farback = Param("How Far back to go", 100, 50, 5000, 10);
nBars = Param("Number of bars", 12, 5, 40);
aHPivs = H - H;
aLPivs = L - L;
aHPivHighs = H - H;
aLPivLows = L - L;
aHPivIdxs = H - H;
aLPivIdxs = L - L;
nHPivs = 0;
nLPivs = 0;
lastHPIdx = 0;
lastLPIdx = 0;
lastHPH = 0;
lastLPL = 0;
curPivBarIdx = 0;
aHHVBars = HHVBars(H, nBars);
aLLVBars = LLVBars(L, nBars);
aHHV = HHV(H, nBars);
aLLV = LLV(L, nBars);
aVisBars = Status("barvisible");
nLastVisBar = LastValue(Highest(IIf(aVisBars, BarIndex(), 0)));
_TRACE("Last visible bar: " + nLastVisBar);
curBar = (BarCount - 1);
curTrend = "";
if (aLLVBars[curBar] < aHHVBars[curBar])
{
curTrend = "D";
}

else
{
curTrend = "U";
}

for (i = 0; i < farback; i++)
{
curBar = (BarCount - 1) - i;
if (aLLVBars[curBar] < aHHVBars[curBar])
{
if (curTrend == "U")
{
curTrend = "D";
curPivBarIdx = curBar - aLLVBars[curBar];
aLPivs[curPivBarIdx] = 1;
aLPivLows[nLPivs] = L[curPivBarIdx];
aLPivIdxs[nLPivs] = curPivBarIdx;
nLPivs++;
}
}
else
{
if (curTrend == "D")
{
curTrend = "U";
curPivBarIdx = curBar - aHHVBars[curBar];
aHPivs[curPivBarIdx] = 1;
aHPivHighs[nHPivs] = H[curPivBarIdx];
aHPivIdxs[nHPivs] = curPivBarIdx;
nHPivs++;
}
}
}

curBar = (BarCount - 1);
candIdx = 0;
candPrc = 0;
lastLPIdx = aLPivIdxs[0];
lastLPL = aLPivLows[0];
lastHPIdx = aHPivIdxs[0];
lastHPH = aHPivHighs[0];
if (lastLPIdx > lastHPIdx)
{
candIdx = curBar - aHHVBars[curBar];
candPrc = aHHV[curBar];
if (lastHPH < candPrc AND candIdx > lastLPIdx AND candIdx < curBar)
{
aHPivs[candIdx] = 1;
for (j = 0; j < nHPivs; j++)
{
aHPivHighs[nHPivs - j] = aHPivHighs[nHPivs - (j + 1)];
aHPivIdxs[nHPivs - j] = aHPivIdxs[nHPivs - (j + 1)];
}
aHPivHighs[0] = candPrc;
aHPivIdxs[0] = candIdx;
nHPivs++;
}
}

else
{
candIdx = curBar - aLLVBars[curBar];
candPrc = aLLV[curBar];
if (lastLPL > candPrc AND candIdx > lastHPIdx AND candIdx < curBar)
{
aLPivs[candIdx] = 1;
for (j = 0; j < nLPivs; j++)
{
aLPivLows[nLPivs - j] = aLPivLows[nLPivs - (j + 1)];
aLPivIdxs[nLPivs - j] = aLPivIdxs[nLPivs - (j + 1)];
}
aLPivLows[0] = candPrc;
aLPivIdxs[0] = candIdx;
nLPivs++;
}
}

for (k = 0; k < nHPivs; k++)
{
_TRACE("High pivot no. " + k + " at barindex: " + aHPivIdxs[k] + ", " + WriteVal(ValueWhen(BarIndex() == aHPivIdxs[k], DateTime(), 1), formatDateTime) + ", " + aHPivHighs[k]);
}

a1 = ahpivs == 1;
a2 = alpivs == 1;
PlotShapes(a1 *shapeSmallCircle, colorRed, 0, H, Offset = 5);
PlotShapes(a2 *shapeSmallCircle, colorGreen, 0, L, Offset = -5);
//////////////////////////////////////////////////////

Para = ParamToggle("Plot Parallel Lines","Off,On");
ColorS= ParamColor("Support",colorLime);
ColorR= ParamColor("Resistance",colorRed);
x = Cum(1);
s1 = L;
s11 = H;
pS = a2 == 1;



endt = LastValue(ValueWhen(ps,x,1));
startt = LastValue(ValueWhen(ps,x,2));
ends = LastValue(ValueWhen(ps,S1,1));
starts = LastValue(ValueWhen(ps,S1,2));
dtS = endt - startt;
aS = (endS - startS) / dtS;
bS = endS;
trendlineS = aS *(x - endt) + bS;
g3 = IIf(x > startt - 10, trendlineS, Null);
Plot(g3, "", colors, styleThick);
pR = a1 == 1;
endt1 = LastValue(ValueWhen(pr,x,1));
startt1 = LastValue(ValueWhen(pr,x,2));
endr = LastValue(ValueWhen(pr,S11,1));
startr = LastValue(ValueWhen(pr,S11,2));
dtR = endt1 - startt1;
aR = (endR - startR) / dtR;
bR = endR;
trendlineR = aR *(x - endt1) + bR;
g4 = IIf(x > startT1 - 10, trendlineR, Null);
Plot(g4, "", colorr, styleThick);

acd = log(endr/startr)/(endt1-startt1);
res1 = exp((x-endt1)*acd)*endr;
RRL = ROC(res1,1);
bcd = log(ends/starts)/(endt-startt);
sup1= exp((x-endt)*bcd)*ends;
RSL = ROC(sup1,1);

Low_Value = LastValue(Ref(LLV(L,endt1-startt1),-(x-endt1)));
x2 = LastValue(ValueWhen(L==Low_Value & x>startt1 & x<endt1,x));
PLL = IIf(LastValue(x)-x2>5,exp((x-x2)*acd)*Low_Value,Null);
Hi_Value = LastValue(Ref(HHV(H,endt-startt),-(x-endt)));
x3 = LastValue(ValueWhen(H==Hi_Value & x>startt & x<endt,x));
PHL = IIf(LastValue(x)-x3>5,exp((x-x3)*bcd)*Hi_Value,Null);
SLabs = sup1-Ref(sup1,-1); RLabs = res1-Ref(res1,-1);
ROC2SL = (SLabs/C)*100; ROC2RL = (RLabs/C)*100;
PLLd = abs((LastValue(C)/LastValue(PLL))-1)<0.01*100;
PHLd = abs((LastValue(C)/LastValue(PHL))-1)<0.01*100;
barvisible = Status("barvisible");
firstvisiblebar = barvisible & NOT
Ref(barvisible,-1);
HHvisible = LastValue(HighestSince(firstvisiblebar,High));
LLvisible = LastValue(LowestSince(firstvisiblebar,Low));
RaH = HHvisible *1.05; RaL = LLVisible *0.95;
AnZ= starts==0 OR ends==0 OR startr==0 OR endr==0;
PLplot = IIf(x-x2>=0 & abs(LastValue(L/PLL)-1) <abs(LastValue((100/1000)*ATR(14))) & PLL>RaL & PLL<RaH & NOT AnZ,PLL,IIf(x-x2>=0 & RaL==0 & PLLd & abs(LastValue(L/PLL)-1) <abs(LastValue((100/1000)*ATR(14)))& NOT AnZ,PLL,Null));
PHplot = IIf(x-x3>=0 & abs(LastValue(H/PHL)-1) <abs(LastValue((100/1000)*ATR(14))) & PHL>RaL & PHL<RaH & NOT AnZ,PHL,IIf(x-x3>=0 & RaL==0 & PHLd & abs(LastValue(H/PHL)-1) <abs(LastValue((100/1000)*ATR(14)))& NOT AnZ,PHL,Null));
Plot(IIf(Para,PLplot,Null)," ",colorr,styleDashed,maskDefault+styleNoRescale);
Plot(IIf(Para,PHplot,Null)," ",colors,styleDashed,maskDefault+styleNoRescale);
_SECTION_END();



رد مع اقتباس
قديم 05-05-2017, 09:25 AM
  المشاركه #4

عضو هوامير المؤسس

تاريخ التسجيل: Aug 2005
المشاركات: 1,834
غنيمة غير متواجد حالياً  

بارك الله فيك


رد مع اقتباس
قديم 05-05-2017, 03:10 PM
  المشاركه #5

عضو هوامير المميز

تاريخ التسجيل: Nov 2010
المشاركات: 13,581
بنك المشاعر غير متواجد حالياً  

في المعادلات خطأ ما ضبطت


رد مع اقتباس
قديم 05-05-2017, 10:40 PM
  المشاركه #6

عضو هوامير المميز

تاريخ التسجيل: Mar 2008
المشاركات: 997
المسلفط غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة بنك المشاعر مشاهدة المشاركة
في المعادلات خطأ ما ضبطت

تم التعديل وان شاء الله تشتغل معك

https://up.top4top.net/downloadf-490uzhhg1-rar.html



رد مع اقتباس
قديم 06-05-2017, 12:52 AM
  المشاركه #7

عضو هوامير المميز

تاريخ التسجيل: Nov 2010
المشاركات: 13,581
بنك المشاعر غير متواجد حالياً  

بارك الله فيك وجزاك كل خير
المسلفط



رد مع اقتباس
إضافة رد


الكلمات الدلالية (Tags)
للايمي, لختراق, معادلة, هل, المقاومات, بروكر, يوجد

أدوات الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع



02:43 PM