Totally agree with you Edward, as a new user, I'm flipping back and forth from the AFL reference manual, the user guide and code… J Thank God for multiple monitors …
As for over the top…I don't agree. I think what you've shown is that AFL/Amibroker is a very powerful platform and what can be done with it…IN THE RIGHT HANDS lol
The interpretation window tip is VERY much appreciated!
When you have some free time, can you explain what the Left sided Pivots are used and what the For loop is intended to do? You can email me at Nurudin.kaba@outlook.com directly or here on the list.
Again, your help is greatly appreciated!
Nurudin
From: amibroker@yahoogroups.com [mailto:amibroker@yahoogroups.com]
Sent: May-01-16 1:11 PM
To: amibroker@yahoogroups.com
Subject: Re: [amibroker] Assist required on below code...
no problem.
when you are new to Amibroker this code is probably tough to understand, and I admit it is a bit over the top. Parts of the code I added to add a white color to the pivot when it is still not confirmed and therefor may disappear when new data comes in.
What I always do is put things like this in the code
"pxn0: " + writeval(pxn0)
"tx1: " + writeval(tx1)
and then put your mouse on a certain bar and look at the interpretation window to see what the values are of the arrays. Then you can more easily understand what is happening inside the arrays
but if you just want the pivots then these 2 lines do all the work:
// 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;
Sent: Sunday, May 01, 2016 7:02 PM
Subject: RE: [amibroker] Assist required on below code...
Thanks Edward for sharing your code. I will study the code below, as a new Amibroker user, the code you have provided is a great learning tool.
Nurudin
From: amibroker@yahoogroups.com [mailto:amibroker@yahoogroups.com]
Sent: May-01-16 12:54 PM
To: amibroker@yahoogroups.com
Subject: Re: [amibroker] Assist required on below code...
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 (8) |
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