الموضوع: معادلة الزجزاج
عرض مشاركة واحدة
قديم 31-12-2017, 09:21 PM   #5
مستثمر أسهم
عضو مميز
 
تاريخ التسجيل: Nov 2013
المشاركات: 801
افتراضي رد: معادلة الزجزاج

اقتباس:
المشاركة الأصلية كتبت بواسطة bohaneen11 مشاهدة المشاركة
اذا خابرين للايمي بروكر نكون شاكرين لكم
كود PHP:
_SECTION_BEGIN("ZIG-ZAG");
Z=Param("zig",1,0,10,0.1);
Plotz1 Zig(C,z), "Zig-zag Indicator" _PARAM_VALUES(), ParamColor("Zig-zag color"colorOrange ), ParamStyle("Zig-zag style") );
 
Buy Cover Zig(C,z)>Ref(Zig(C,z),-1) AND Ref(Zig(C,z),-2)>Ref(Zig(C,z),-1);
Sell Short Zig(C,z)<Ref(Zig(C,z),-1) AND Ref(Zig(C,z),-2)<Ref(Zig(C,z),-1);
 
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
 
Filter Buy OR Sell;
 
PlotShapes(IIf(BuyshapeCircleshapeNone),colorGreen0,BuyPrice0);
PlotShapes(IIf(SellshapeCircleshapeNone),colorRed0,SellPrice0);
 
dist 1.5*ATR(10);
for( 
0BarCounti++ )
{
if( 
Buy[i] ) PlotText"BUY\n"+C], iBuyPrice[i]-dist[i],colorWhitecolorGreen );
if( 
Sell[i] ) PlotText"SELL\n"+C], iSellPrice[i]+dist[i],colorWhitecolorRed );
//if( Short[i] ) PlotText( "Short\n@" + C[ i ], i, H[ i ]+dist[i], colorRed, colorYellow );
//if( Cover[i] ) PlotText( "Cover\n@" + C[ i ], i, L[ i ]-dist[i],colorGreen );

و

كود PHP:
_SECTION_BEGIN("Reversal");
Reversal Param_DEFAULT_NAME(), 01.0,0.01,20,0.01);
_SECTION_END();
 
ZigZArray Avg;
ZigZArray Null;
 
ValFromPro=0;
ValToPro=0;
ValRead=0;
 
BarFromPro=0;
BarToPro=0;
BarRead=0;
 
ProcessUndef 10;
ProcessIncrease 11;
ProcessDecrease 12;
 
Process ProcessUndef;
ValFromPro=Avg[0];
ValToPro=Avg[0];
BarFromPro=0;
BarToPro=0;
BarRead=0;
 
function 
FillLinestartbarstartvalendbarendval )
{
    for( 
startbar<= endbarj++ )
    {
        
ZigZArray] = startval + (( startbar) * (endval-startval)/( endbar startbar ));
    }
}
 
function 
TrtUndef( )
{
    if ( 
ValRead > ( ((100 Reversal)/100 ) * ValFromPro ) )///If rupture Increase
    
{
        
Process ProcessIncrease;
        
ValToPro=ValRead;
        
BarToPro=BarRead;
    }
    else
    {
        if ( 
ValRead < ( ((100Reversal)/100 ) * ValFromPro ) )  // If rupture Decrease
        
{
            
Process ProcessDecrease;
            
ValToPro=ValRead;
            
BarToPro=BarRead;
        }
        else
        {
            
Process ProcessUndef;
        }
    }
}
 
function 
TrtIncrease( )
{
    if ( 
ValRead ValToPro )  // Still Increase
    
{
        
Process ProcessIncrease;
        
ValToPro=ValRead;
        
BarToPro=BarRead;
    }
    else   
// Break Increase Process
    
{
        if ( 
ValRead <  ( ((100Reversal)/100 ) * ValToPro ) )   // If break Decrease
        
{
            
Process ProcessDecrease;
            
ValFromPro=ValToPro;
            
BarFromPro=BarToPro;
            
ValToPro=ValRead;
            
BarToPro=BarRead;
        }
    }
}
 
function 
TrtDecrease( )
{
    if ( 
ValRead ValToPro )  // Still Decrease
    
{
        
Process ProcessDecrease;
        
ValToPro=ValRead;
        
BarToPro=BarRead;
    }
    else  
// Break Decrease Process
    
{
        if ( 
ValRead >  ( ( (100Reversal)/100 ) * ValToPro ) ) // If break Decrease
        
{
           
Process ProcessIncrease;
            
ValFromPro=ValToPro;
            
BarFromPro=BarToPro;
            
ValToPro=ValRead;
            
BarToPro=BarRead;
        }
    }
}
 
 
for( 
1BarCounti++ )
{
    
ValRead Avg[i];
    
BarRead i;
 
    if ( 
Process == ProcessUndef )
    {
        
TrtUndef();
    }
    else
    {
        if ( 
Process == ProcessIncrease )
        {
            
TrtIncrease();
        }
        else
        {
            
TrtDecrease();
        }
    }
 
    if ( 
BarToPro == BarRead )
        
FillLineBarFromProValFromProBarToProValToPro );
    else
        
FillLineBarToProValToProBarReadValRead );
}
 
 
_SECTION_BEGIN("avg");
SetChartOptions(0,chartShowArrows);
PlotAvg_DEFAULT_NAME(), ParamColor("Color"colorBlack ), ParamStyle("Style"styleLine styleDotsmaskPrice ) ); 
_SECTION_END();
 
 
_SECTION_BEGIN("ZigZArray");
PlotZigZArray_DEFAULT_NAME(), ParamColor("Color"colorRed ), ParamStyle("Style"styleLine styleThick) ); 
_SECTION_END(); 

و

كود PHP:
//z_ZigZagValid
// ******** CHARTING 
PercentChange 6;
mystartbar SelectedValue(BarIndex());  // FOR GRAPHING
 
mystartbardate LastValue(ValueWhen(mystartbar == BarIndex(), DateNum(),1));
 
InitialValue LastValue(ValueWhen(mystartbardate == DateNum(), ) ) ;
Temp1 IIf(BarIndex() >= mystartbarInitialValueNull) ;
Plot(Temp1" "colorBlack,styleLine);
Plot((1+(LastValue(PercentChange)/100))*(Temp1), " "colorGreenstyleLine) ;
Plot((1-(LastValue(PercentChange)/100))*(Temp1), " "colorRedstyleLine) ;
 
ZZ Zig(C,LastValue(PercentChange)) ; 
PivotLow Ref(IIf(Ref(ROC(ZZ,1),-1) < AND ROC(ZZ,1) > 01Null),1);
PivotHigh Ref(IIf(Ref(ROC(ZZ,1),-1) > AND ROC(ZZ,1) < 01Null),1);
 
PlotShapesshapeCircle*PivotLowcolorGreen,0L, -20) ; 
PlotShapesshapeCircle*PivotHigh,colorRed,0,H20) ;
 
Buy_Valid IIf(C>(1+(LastValue(PercentChange)/100))*(ValueWhen(PivotLowC,
1))
AND 
ROC(ZZ,1) > 0,1,0); 
Sell_Valid IIf(C<(1-(LastValue(PercentChange)/100))*(ValueWhen(PivotHighC,
1))
AND 
ROC(ZZ,1) < 0,1,0); 
 
Buy_Valid ExRem(Buy_Valid,Sell_Valid);
Sell_Valid ExRem(Sell_Valid,Buy_Valid);
 
PlotShapesshapeUpArrow*Buy_ValidcolorGreen,0L, -20); 
PlotShapesshapeDownArrow*Sell_ValidcolorRed,0,H, -20) ; 
مستثمر أسهم غير متواجد حالياً   رد مع اقتباس
  #5  
قديم 31-12-2017 , 09:21 PM
مستثمر أسهم مستثمر أسهم غير متواجد حالياً
عضو مميز
تاريخ التسجيل: Nov 2013
المشاركات: 801
افتراضي رد: معادلة الزجزاج

اقتباس:
المشاركة الأصلية كتبت بواسطة bohaneen11 مشاهدة المشاركة
اذا خابرين للايمي بروكر نكون شاكرين لكم
كود PHP:
_SECTION_BEGIN("ZIG-ZAG");
Z=Param("zig",1,0,10,0.1);
Plotz1 Zig(C,z), "Zig-zag Indicator" _PARAM_VALUES(), ParamColor("Zig-zag color"colorOrange ), ParamStyle("Zig-zag style") );
 
Buy Cover Zig(C,z)>Ref(Zig(C,z),-1) AND Ref(Zig(C,z),-2)>Ref(Zig(C,z),-1);
Sell Short Zig(C,z)<Ref(Zig(C,z),-1) AND Ref(Zig(C,z),-2)<Ref(Zig(C,z),-1);
 
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
 
Filter Buy OR Sell;
 
PlotShapes(IIf(BuyshapeCircleshapeNone),colorGreen0,BuyPrice0);
PlotShapes(IIf(SellshapeCircleshapeNone),colorRed0,SellPrice0);
 
dist 1.5*ATR(10);
for( 
0BarCounti++ )
{
if( 
Buy[i] ) PlotText"BUY\n"+C], iBuyPrice[i]-dist[i],colorWhitecolorGreen );
if( 
Sell[i] ) PlotText"SELL\n"+C], iSellPrice[i]+dist[i],colorWhitecolorRed );
//if( Short[i] ) PlotText( "Short\n@" + C[ i ], i, H[ i ]+dist[i], colorRed, colorYellow );
//if( Cover[i] ) PlotText( "Cover\n@" + C[ i ], i, L[ i ]-dist[i],colorGreen );

و

كود PHP:
_SECTION_BEGIN("Reversal");
Reversal Param_DEFAULT_NAME(), 01.0,0.01,20,0.01);
_SECTION_END();
 
ZigZArray Avg;
ZigZArray Null;
 
ValFromPro=0;
ValToPro=0;
ValRead=0;
 
BarFromPro=0;
BarToPro=0;
BarRead=0;
 
ProcessUndef 10;
ProcessIncrease 11;
ProcessDecrease 12;
 
Process ProcessUndef;
ValFromPro=Avg[0];
ValToPro=Avg[0];
BarFromPro=0;
BarToPro=0;
BarRead=0;
 
function 
FillLinestartbarstartvalendbarendval )
{
    for( 
startbar<= endbarj++ )
    {
        
ZigZArray] = startval + (( startbar) * (endval-startval)/( endbar startbar ));
    }
}
 
function 
TrtUndef( )
{
    if ( 
ValRead > ( ((100 Reversal)/100 ) * ValFromPro ) )///If rupture Increase
    
{
        
Process ProcessIncrease;
        
ValToPro=ValRead;
        
BarToPro=BarRead;
    }
    else
    {
        if ( 
ValRead < ( ((100Reversal)/100 ) * ValFromPro ) )  // If rupture Decrease
        
{
            
Process ProcessDecrease;
            
ValToPro=ValRead;
            
BarToPro=BarRead;
        }
        else
        {
            
Process ProcessUndef;
        }
    }
}
 
function 
TrtIncrease( )
{
    if ( 
ValRead ValToPro )  // Still Increase
    
{
        
Process ProcessIncrease;
        
ValToPro=ValRead;
        
BarToPro=BarRead;
    }
    else   
// Break Increase Process
    
{
        if ( 
ValRead <  ( ((100Reversal)/100 ) * ValToPro ) )   // If break Decrease
        
{
            
Process ProcessDecrease;
            
ValFromPro=ValToPro;
            
BarFromPro=BarToPro;
            
ValToPro=ValRead;
            
BarToPro=BarRead;
        }
    }
}
 
function 
TrtDecrease( )
{
    if ( 
ValRead ValToPro )  // Still Decrease
    
{
        
Process ProcessDecrease;
        
ValToPro=ValRead;
        
BarToPro=BarRead;
    }
    else  
// Break Decrease Process
    
{
        if ( 
ValRead >  ( ( (100Reversal)/100 ) * ValToPro ) ) // If break Decrease
        
{
           
Process ProcessIncrease;
            
ValFromPro=ValToPro;
            
BarFromPro=BarToPro;
            
ValToPro=ValRead;
            
BarToPro=BarRead;
        }
    }
}
 
 
for( 
1BarCounti++ )
{
    
ValRead Avg[i];
    
BarRead i;
 
    if ( 
Process == ProcessUndef )
    {
        
TrtUndef();
    }
    else
    {
        if ( 
Process == ProcessIncrease )
        {
            
TrtIncrease();
        }
        else
        {
            
TrtDecrease();
        }
    }
 
    if ( 
BarToPro == BarRead )
        
FillLineBarFromProValFromProBarToProValToPro );
    else
        
FillLineBarToProValToProBarReadValRead );
}
 
 
_SECTION_BEGIN("avg");
SetChartOptions(0,chartShowArrows);
PlotAvg_DEFAULT_NAME(), ParamColor("Color"colorBlack ), ParamStyle("Style"styleLine styleDotsmaskPrice ) ); 
_SECTION_END();
 
 
_SECTION_BEGIN("ZigZArray");
PlotZigZArray_DEFAULT_NAME(), ParamColor("Color"colorRed ), ParamStyle("Style"styleLine styleThick) ); 
_SECTION_END(); 

و

كود PHP:
//z_ZigZagValid
// ******** CHARTING 
PercentChange 6;
mystartbar SelectedValue(BarIndex());  // FOR GRAPHING
 
mystartbardate LastValue(ValueWhen(mystartbar == BarIndex(), DateNum(),1));
 
InitialValue LastValue(ValueWhen(mystartbardate == DateNum(), ) ) ;
Temp1 IIf(BarIndex() >= mystartbarInitialValueNull) ;
Plot(Temp1" "colorBlack,styleLine);
Plot((1+(LastValue(PercentChange)/100))*(Temp1), " "colorGreenstyleLine) ;
Plot((1-(LastValue(PercentChange)/100))*(Temp1), " "colorRedstyleLine) ;
 
ZZ Zig(C,LastValue(PercentChange)) ; 
PivotLow Ref(IIf(Ref(ROC(ZZ,1),-1) < AND ROC(ZZ,1) > 01Null),1);
PivotHigh Ref(IIf(Ref(ROC(ZZ,1),-1) > AND ROC(ZZ,1) < 01Null),1);
 
PlotShapesshapeCircle*PivotLowcolorGreen,0L, -20) ; 
PlotShapesshapeCircle*PivotHigh,colorRed,0,H20) ;
 
Buy_Valid IIf(C>(1+(LastValue(PercentChange)/100))*(ValueWhen(PivotLowC,
1))
AND 
ROC(ZZ,1) > 0,1,0); 
Sell_Valid IIf(C<(1-(LastValue(PercentChange)/100))*(ValueWhen(PivotHighC,
1))
AND 
ROC(ZZ,1) < 0,1,0); 
 
Buy_Valid ExRem(Buy_Valid,Sell_Valid);
Sell_Valid ExRem(Sell_Valid,Buy_Valid);
 
PlotShapesshapeUpArrow*Buy_ValidcolorGreen,0L, -20); 
PlotShapesshapeDownArrow*Sell_ValidcolorRed,0,H, -20) ; 
رد مع اقتباس