Simple Coding Help - No Promise.

amitrandive

Well-Known Member
Friends - In this Opening Range breakout afl not always signals are generated pls help to correct the mistake in the AFL.
Thanks in advance.

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

_SECTION_END();


breakoutime = 093000;

afterbreakout0 = Cross(TimeNum(),093000);
afterbreakout1 = TimeNum()>=093000;

NewDay = Day()!= Ref(Day(), -1);

highestoftheday = HighestSince(Newday,H,1);
Lowestoftheday = LowestSince(Newday,L,1);

ORBHigh = ValueWhen(afterbreakout0,highestoftheday,1);
ORBLow = ValueWhen(afterbreakout0,lowestoftheday,1);

Plot(C,"",colorGreen,styleCandle);
Range = ORBHigh - ORBLow;

TimeFrameSet(in1Minute);

Buy = Cross(C,orbhigh) AND afterbreakout1;
Sell = Cross(orblow,C) AND afterbreakout1;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

Short=Cross(C,ORblow) AND afterbreakout1;
Cover=Cross(ORbhigh,C) AND afterbreakout1;

PlotShapes( shapeUpArrow * Buy, colorGreen,0,L,-12);
PlotShapes( shapeDownArrow * Sell, colorRed,0,H,-12);

//Plot(afterbreakout0,"",colorBlue,styleHistogram|styleOwnScale);

Plot(ORBHigh,"",colorGreen,styleDots);
Plot(ORBLow,"",colorRed,styleDots);
AFL is working correctly, maybe does not catch the earlier signals as you have set the breakout time as 09300.

For changing that change the following lines in your code,
Code:
breakoutime = [B][COLOR="Red"]091500[/COLOR];[/B]

afterbreakout0 = Cross(TimeNum(),[B][COLOR="Red"]091500[/COLOR][/B]);
afterbreakout1 = TimeNum()>=[B][COLOR="Red"]091500[/COLOR][/B];
 
Sirs,
Is der a way 2 merge the Symbols in Bulk like if need to merge Nifty2 wid Nifty1 , BnkNifty2 wid BnkNifty1, CrudeOil2 wid CrudeOil1 .....and so on in a single or few clicks instead of using the Amibroker built-in merge feature which allows only one symbol to merge at a time ?

Pls Help / Guide / Give a Hint / Advise to STOP searching if its NOT Possible.

Thank u all

Shiraj
 
Hi,

Can anyone please help me with an AFL for exploring the scrips that meet the following conditions? The example shown is for ACC. The day under consideration is 13-1-2015.

1. MACD gives a 'Buy' signal when the price closes below all the 3 EMAs (31-12-2014). The EMAs used are 12-day, 26-day and 39-day.

2. Price closes above all the 3 EMAs (05-01-2015).

3. Price closes below all the 3 EMAs (06-01-2015 to 09-01-2015). But the MACD does not give 'Sell' signal. It remains above the signal line.

4. Finally the price closes above all the 3 EMAs (13-01-2015).

Thanks
pennywize

 
Last edited:
Sirs,
Is der a way 2 merge the Symbols in Bulk like if need to merge Nifty2 wid Nifty1 , BnkNifty2 wid BnkNifty1, CrudeOil2 wid CrudeOil1 .....and so on in a single or few clicks instead of using the Amibroker built-in merge feature which allows only one symbol to merge at a time ?

Pls Help / Guide / Give a Hint / Advise to STOP searching if its NOT Possible.

Thank u all

Shiraj
I too am looking for it....
 
Hello all,

Need small help from seniors..

Need exploration of following conditions ..

1) Price </> then 5 SMA

2) Stochastic Crossover 5'3

3) cci above/Below 100/-100


Please check the pictures once....

Thanx you
 
Last edited:

Dawood

Active Member
crossup= c>ema(c,20);
if(StrToNum(NumToStr(crossup)))bgColor = colorGreen;
else bgColor = colorRed;
SetChartBkGradientFill( colorBlack, bgColor);
This code changes background color if close is above or below Ema 20...Is it possible to make green background if close is above ema13 and red background if close is below ema3
 

amitrandive

Well-Known Member
This code changes background color if close is above or below Ema 20...Is it possible to make green background if close is above ema13 and red background if close is below ema3
Is this a typo ?
Should it be EMA13?
If it is EM13,its easy

replace ema(c,20) in your code with ema(C,13)
 
Last edited:
Sirs,
Pls Give a script (Java or other) for Auto saving RT data to Amibroker default DataBase and also to an Additional DataBase in a Different Drive & Folder.

Thank u
Shiraj
 

Similar threads