you can best do this while constructing the fractal pivot, see fractal pivots I use:
x = BarIndex();
Lx = LastValue( x );
rightStrength = Param( "Fractal Pivot Right side Strength", 2, 0, 50, 1 );
leftStrength = Param( "Fractal Pivot Left side Strength", 2, 0, 50, 1 );
// complete pivots
pk = H > Ref( HHV( H, leftStrength ), -1 ) AND Ref( HHV( H, rightStrength ), rightStrength ) <= H;
tr = L < Ref( LLV( L, leftStrength ), -1 ) AND Ref( LLV( L, rightStrength ), rightStrength ) >= L;
// left sided pivots
pkn = H > Ref( HHV( H, ( leftStrength ) ), -1 );
trn = L < Ref( LLV( L, ( leftStrength ) ), -1 );
for( i = 0; i < 3; i++ )
{
VarSet( "px" + i, ValueWhen( pk, x, i ) );
VarSet( "tx" + i, ValueWhen( tr, x, i ) );
VarSet( "ph" + i, ValueWhen( pk, H, i ) );
VarSet( "tl" + i, ValueWhen( tr, L, i ) );
VarSet( "pxn" + i, ValueWhen( pkn, x, i ) );
VarSet( "txn" + i, ValueWhen( trn, x, i ) );
}
GraphXSpace = 5;
SetChartBkColor( colorBlack );
SetChartOptions( 0, chartShowDates );
SetBarFillColor( IIf( C > O, colorGreen, IIf( C <= O, colorRed, colorLightGrey ) ) );
Plot( C, "Last", IIf( C > O, colorDarkGreen, IIf( C <= O, colorDarkRed, colorLightGrey ) ), 64, null, null, 0, 0, 1 );
PlotShapes( shapeSmallCircle*tr, IIf( Lx - ValueWhen( tr, x ) >= rightStrength OR pxn0 > tx1, ColorRGB( 0, 100, 0 ), colorWhite ), 0, L, -10 );
PlotShapes( shapeSmallCircle*pk, IIf( Lx - ValueWhen( pk, x ) >= rightStrength OR txn0 > px1, ColorRGB( 255, 0, 0 ), colorWhite ), 0, H, 10 );
Sent: Saturday, April 30, 2016 8:43 PM
Subject: [amibroker] Assist required on below code...
I'm using the below code and was wondering if anyone can assist in correcting or showing me where I'm going wrong…
The idea is the place the green dot on the middle bar at the high on the attached graphic
_Section_Begin("TestBARDot");
UpFractalBW = IIf(((Ref(H,-1) >= Ref(H, -2)) AND (Ref(H,-1) >= H)),True,False);
Buy = UpFractalBW;
Shape = Buy * shapeCircle;
Plot( Close, "Price", colorBlack, stylebar );
PlotShapes( shape, IIf(Buy , colorGreen, 0 ), 0, IIf( Buy, High, Low ),0 );
GraphXSpace = 5;
_SECTION_END();
I know it's the UpFractalBW array that is assigned the true value one bar late…how to I place the true value in the array at Ref(H,1) ?
Any assistance would be greatly appreciated!
__._,_.___
Posted by: "Edward Pottasch" <empottasch@skynet.be>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
.
__,_._,___
EmoticonEmoticon