Wysiwyg
Everyone wants money
- Joined
- 8 August 2006
- Posts
- 8,428
- Reactions
- 284
Buy = Cross(RSI(), 50);
Sell = Cross(50, RSI());
Distance = 1.5 * ATR(100);
for(i = 0; i < BarCount; i++)
{
if(Buy[i]) PlotText("" + Name(), i, L[i] -Distance[i], colorBlack);
}
PlotShapes(IIf(Buy, shapeSmallCircle, 0), colorBrightGreen, 0, L, -15);
Thomas created this simple loop awhile ago. Hope it helps. As I posted in the P.M., I had a go at Time stamping the buy bar but couldn't get a native function to plot the time. Note -- I am not a coder.
Code:Buy = Cross(RSI(), 50); Sell = Cross(50, RSI()); Distance = 1.5 * ATR(100); for(i = 0; i < BarCount; i++) { if(Buy[i]) PlotText("" + Name(), i, L[i] -Distance[i], colorBlack); } PlotShapes(IIf(Buy, shapeSmallCircle, 0), colorBrightGreen, 0, L, -15);
View attachment 66720
SetOption("NoDefaultColumns", True );
Plot(C, "",colorLightGrey, styleCandle) //For seeing chart
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= (ABS(O - C ) <= ((H - L ) * 0.1))
bar= Name() + "\t";
bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t";
x= StrFormat("%02g-min", i);
[COLOR="#008000"] bar = bar+ WriteIf(up, x, "\t");
[/COLOR]
addRow(bar );
TimeframeRestore();
m1 = TimeFrameExpand(up,in1Minute);
}
f[COLOR="#FF0000"][COLOR="#008000"]or(b=0; b<BarCount;, b++)
{
if(up[b] == True) PlotText(":",b + WriteVal(up),colorAqua, bkcolor =colorDefault);
}
PlotShapes(up*shapeSmallCircle,colorGreen,0,Low,-20);[/COLOR][/COLOR]
Hi wysiwyg,thanks..
it's bit different than this code, code that you mentioned is kind of similiar to manual.
Kindly see pic.
View attachment 66724
View attachment 66725
Code:SetOption("NoDefaultColumns", True ); Plot(C, "",colorLightGrey, styleCandle) //For seeing chart 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= (ABS(O - C ) <= ((H - L ) * 0.1)) bar= Name() + "\t"; bar= bar+ DateTimeToStr(LastValue(DateTime()))+ "\t"; x= StrFormat("%02g-min", i); [COLOR="#008000"] bar = bar+ WriteIf(up, x, "\t"); [/COLOR] addRow(bar ); TimeframeRestore(); m1 = TimeFrameExpand(up,in1Minute); } f[COLOR="#FF0000"][COLOR="#008000"]or(b=0; b<BarCount;, b++) { if(up[b] == True) PlotText(":",b + WriteVal(up),colorAqua, bkcolor =colorDefault); } PlotShapes(up*shapeSmallCircle,colorGreen,0,Low,-20);[/COLOR][/COLOR]
Kindly try to change in this.
regards
_SECTION_BEGIN("exprimenting");
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);
O1 = Ref(O,-1); C1 = Ref(C,-1);
O2 = Ref(O,-2); C2 = Ref(C,-2);
up= C1>O1;
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);
}
Distance = 1.5 * ATR(100);
for(b=0; b<BarCount;, b++)
{
if(up[b] == True)PlotText(":1" + up[b], b, L[b] -Distance[b], colorAqua);
}
PlotShapes(up[i]*shapeSmallCircle,colorGreen,0,Low,-20);
Plot(C, "",colorLightGrey, styleCandle); //For seeing chart
_SECTION_END();
//Price swing
//Locate oversold and overbought in last 5 days
OS = C < Ref(C, -5);
OB = C > Ref(C, -5);
//Maximum bullish price swing
D1 = Ref(H, -1) - Ref(O, -1);
D2 = Ref(H, -2) - Ref(O, -2);
D3 = Ref(H, -3) - Ref(O, -3);
D4 = Ref(H, -4) - Ref(O, -4);
BullAverage = (D1 + D2 + D3 + D4)/4;
//Maximum bearish price swing
D1 = Ref(C, -1) - Ref(L, -1);
D2 = Ref(C, -2) - Ref(L, -2);
D3 = Ref(C, -3) - Ref(L, -3);
D4 = Ref(C, -4) - Ref(L, -4);
BearAverage = (D1 + D2 + D3 + D4)/4;
//Long/short signal
Long = (Ref(H, 0) - Ref(O, 0)) >= (BullAverage * 1.75);
Short = (Ref(C, 0) - Ref(L, 0)) >= (BearAverage * 1.75);
// Price and Volume
PVFilter = Ref(MA(V,50),-1)>100000;
//test
LS = Ref(H, 0) - Ref(O, 0);
SS = Ref(C, 0) - Ref(L, 0);
// Columns
NumColumns = 7;
Column0 = FullName();
Column0Name = "Ticker name";
Column1 = IIf(PVFilter AND OS AND Long, 1, 0);
Column1Name = "Buy Signal";
Column2 = IIf(PVFilter AND OB AND Short, 1, 0);
Column2Name = "Sell Signal";
Column3 = BullAverage;
Column3Name = "MaxBullSwing";
Column4 = BearAverage;
Column4Name = "MaxBearSwing";
Column5 = LS;
Column5Name = "long";
Column6 = SS;
Column6Name = "short";
AddTextColumn( SectorID(1), "Sector" );
AddTextColumn( MarketID(1), "Market" );
// Filter
Filter = Column1 OR Column2;
That is a short signal arrow built in to Amibroker. To turn signal arrows off go to parameters window - axes and grid - show trading arrows yes and click to no.How do i get the red hollow arrow out? anybody?
That is a short signal arrow built in to Amibroker. To turn signal arrows off go to parameters window - axes and grid - show trading arrows yes and click to no.
For the present bar, this (Ref(H, 0) - Ref(O, 0)) = this (H - L)
Yes sorry I meant H - O.
for(i=1; i<=5; i++) {
TimeframeSet(i * in1Minute);
up15= C > O;
TimeframeRestore();
}
for(i=10; i<=15; i++) {
TimeframeSet(i * (2*in5Minute));
up1015= C > O;
TimeframeRestore();
}
expandmode = expandPoint;
up15= TimeFrameExpand(up15, in1minute, expandmode);
up1015 = TimeFrameExpand(up1015, (10*in1Minute), expandmode);
Plot( C, "Price", colorYellow, styleCandle );
PlotShapes( IIF( up15 AND up1015, shapeUpArrow , shapeNone ), colorAqua );
Hi,
I want help in this code. I got it from one member. he sent this question i also tried it .
Code:for(i=1; i<=5; i++) { TimeframeSet(i * in1Minute); up15= C > O; TimeframeRestore(); } for(i=10; i<=15; i++) { TimeframeSet(i * (2*in5Minute)); up1015= C > O; TimeframeRestore(); } expandmode = expandPoint; up15= TimeFrameExpand(up15, in1minute, expandmode); up1015 = TimeFrameExpand(up1015, (10*in1Minute), expandmode); Plot( C, "Price", colorYellow, styleCandle ); PlotShapes( IIF( up15 AND up1015, shapeUpArrow , shapeNone ), colorAqua );
QUESTION:
if there is bar PATTERN BETWEEN 1min. to 5min.
if there is bar PATTERN BETWEEN 10min. to 15min.
if BOTH CONDITION IS RIGHT..
putting arrow on 1 min. timeframe.
PROBLEM:
which expandmode function should be used ?
1. Is this code right?
2. In this problem , arrow isn't stable, IT'S MOVING with price.
Kindly give your opinion..
regards
Hi, In gif pic( below link) ,you can see Arrow is not aligned with price (candlestick)? as i mentioned in 2, Kindly help.
http://imgur.com/gJ1tP69
regards
Anyone? '
I tried to show up with animated gif ..
regards
mtftrader
fxtraders
Your code too advanced for me. I only have EOD data. But I hope you maybe get help from complete post here:
fxtraders
Your code too advanced for me. I only have EOD data. But I hope you maybe get help from complete post here:
http://www.traderji.com/amibroker/1...frame-not-pattern-single-timeframe-p2-15.html
Hi everyone,
Hi everyone,
Sorry for such a basic question, but I have read the Amibroker manual, and searched pages and pages on Google and can't find the answer.
Basically, I want to change the parameters on the Bollinger Band to a 100 day moving average with the upper band set to 3 standard deviations and the lower band set at 1 standard deviation.
Below is the code for the standard Amibroker settings, what exactly do I need to change?
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 300, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style );
Thanks for any help,
Steve
a = BBandTop(C,100,3);
b = BBandBot(C,100,3);
Plot(a,"top",colorBlack);
Plot(b,"bott",colorBlack);
[edited]
This might help, just watched it last night.
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?