- Joined
- 30 June 2007
- Posts
- 7,200
- Reactions
- 1,226
Thanks Gringotts. I was then looking for price to close back down below the high of the previous pivot.
I don't think that can be done if the swing is calculated using Zig eg:
Buy = H>(Ref(swinghi,-1)) AND C<(Ref(swinghi,-1)) ;
I've been trying this but for some reason AB won't have it and misses many signals
Logic seems correct to me.
SwingHi= H>Ref(H,-1) AND H>Ref(H,1);
BO= (L>ValueWhen(swingHi,H,1)) AND (C<ValueWhen(swingHI,H,1));
PlotShapes(shapeSmallCircle*SWINGHi,colorBLUE, 0, H, 20);
Buy = SwingHi;
This is the JHX daily chart for example. Note no green arrow buy signal on yesterday's candlestick? But there was one correctly identified 4 days ago.
View attachment 66545
Plot this, so you can see the zig line, then backtest. You'll see it works for what you want.
[edited]
swinghi= Peak(H,5,1);
Buy = H>ref(swinghi,-1) AND C<Ref(swinghi,-1);
Sell = False;
Plot(Zig(H,5),"",colorBlack);
Thanks for your help Gringotts Bank
Thank you Gringotts bank.
Thanks rnr. I couldn't get the code to work but thanks for you effort
At the end you have to change the >= -40 to <= -40 for a negative number. Also your 10 conditions use a specific Close price back from 10 bars to 180 bars ago. So you are getting the % change for each specific referenced Close. Mine referenced the High.
Hope this helps.
Just wondering if you are trying to find an edge in going long on a 40% or more price decline over some period?Oh yeah the symbol. Oh okay i see it now with the reference. Thanks.
Hi,
May i know what function would you use ? If you want to make something like ?
KIndly reply
I wrote question in picture..
The exploration returns the search for a condition and that condition could be plotted on the chart.
something like this will plot a green circle below the bar.
PlotShapes(shapeSmallCircle*Buy,colorGreen,0,Low,-20);
Hi Wysiwyg,
thanks
In my question, it's under Buy column, its results xyz under Buy column ..
I don't wanna put them below candlestick charts.. means
exploration done 15/5/2016 1:05pm xyz(that is results under Buy column)
=> it just put xyz under Buy column .
again exploration done 15/5/2016 1:10pm yzm(that is result under Buy column, m a new value )
=> Now candlestick is next candlestick ,Now i wanna put it yzm under that candlestick ..
May i know , How would you do it?
1. and it's possible?
View attachment 66693
http://i.imgur.com/sn4XLWy.png
2. Kindly may i know what function would you use do it? align that exploration results of a column to under candlestick?( How do you put those values under candlestick?)
regards
Just wondering if you are trying to find an edge in going long on a 40% or more price decline over some period?
Hi Wysiwyg,
thanks
In my question, it's under Buy column, its results xyz under Buy column ..
I don't wanna put them below candlestick charts.. means
exploration done 15/5/2016 1:05pm xyz(that is results under Buy column)
=> it just put xyz under Buy column .
again exploration done 15/5/2016 1:10pm yzm(that is result under Buy column, m a new value )
=> Now candlestick is next candlestick ,Now i wanna put it yzm under that candlestick ..
May i know , How would you do it?
and it's possible?
View attachment 66693
http://i.imgur.com/sn4XLWy.png
Kindly may i know what function would you use do it? align that exploration results of a column to under candlestick?
regards
Hi,
MY main question is different, but thanks for answer. I've pointed it with point 1 and point 2.
with picture .. easier to under question .. If you need more explanation, let me know, i've described it in details already .
SetOption("NoDefaultColumns", True );
AddColumn( Null, "Symbol", 1, colorDefault, colorDefault, 70 );
AddColumn( Null, "DateTime", 1, colorDefault, colorDefault, 150 );
AddColumn( Null, "bar", 1, colorDefault, colorDefault, 70 );
dt = DateTime();
filter = 0;
for(i=1; i<=10; i++) {
TimeframeSet(i * in1Minute);
up= C>O;
bar= Name() + "\t";
bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t";
x= StrFormat("%02g-min", i);
bar = bar+ WriteIf(up, x, "\t");
addRow(bar );
TimeframeRestore();
m1 = TimeFrameExpand(up,in1Minute);
}
Hi,
i post these two picture again WITH FORMULA YOU CAN TRY WITH.
View attachment 66700
View attachment 66701
AND FORMULA :Code:SetOption("NoDefaultColumns", True ); AddColumn( Null, "Symbol", 1, colorDefault, colorDefault, 70 ); AddColumn( Null, "DateTime", 1, colorDefault, colorDefault, 150 ); AddColumn( Null, "bar", 1, colorDefault, colorDefault, 70 ); dt = DateTime(); filter = 0; for(i=1; i<=10; i++) { TimeframeSet(i * in1Minute); up= C>O; bar= Name() + "\t"; bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t"; x= StrFormat("%02g-min", i); bar = bar+ WriteIf(up, x, "\t"); addRow(bar ); TimeframeRestore(); m1 = TimeFrameExpand(up,in1Minute); }
I WANT TO USE THIS CODE AS EXAMPLE, AND WANT TO PLOT AS PER UNDER CANDLESTICK, AS I WRITTEN IN PICTURE. WHAT DO YOU ADD IN CODE TO MAKE IT LIKE UP?
I WISH QUESTION IS NEAT AND CLEAR , TRIED TO WRITE AS SIMPLE AS POSSIBLE AND IN GRAPHIC WAY. LET ME KNOW IF ANYTHING NEED TO BE ADDED
REGARDS
Hi,
i post these two picture again WITH FORMULA YOU CAN TRY WITH.
View attachment 66700
View attachment 66701
AND FORMULA :Code:SetOption("NoDefaultColumns", True ); AddColumn( Null, "Symbol", 1, colorDefault, colorDefault, 70 ); AddColumn( Null, "DateTime", 1, colorDefault, colorDefault, 150 ); AddColumn( Null, "bar", 1, colorDefault, colorDefault, 70 ); dt = DateTime(); filter = 0; for(i=1; i<=10; i++) { TimeframeSet(i * in1Minute); up= C>O; bar= Name() + "\t"; bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t"; x= StrFormat("%02g-min", i); bar = bar+ WriteIf(up, x, "\t"); addRow(bar ); TimeframeRestore(); m1 = TimeFrameExpand(up,in1Minute); }
I WANT TO USE THIS CODE AS EXAMPLE(the exploration code that i wrote ), AND WANT TO PLOT AS PER UNDER CANDLESTICK(kindly see), AS I've WRITTEN IN PICTURE([ ). WHAT DO YOU ADD IN CODE TO MAKE IT LIKE UP?(this means, If i want ouput under candlestick, as i described in pic(same pic i posted two pic here), What modification do i need in code?)
I WISH QUESTION IS NEAT AND CLEAR , TRIED TO WRITE AS SIMPLE AS POSSIBLE AND IN GRAPHIC WAY. LET ME KNOW IF ANYTHING NEED TO BE ADDED
REGARDS
Post a screen shot of your exploration, that might help
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?