Simple Coding Help - No Promise.

Dawood

Active Member
Dear sr114
Please see the attached image as per CASONI'S code

SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Stime =151500;
Etime = 153000;
TN = TimeNum();
ST = TN == Stime ;
ET = TN == Etime ;
BS = ValueWhen ( ST, Cum(1)-1);
BE = ValueWhen ( ET, Cum(1)-1);
Bar = BE - BS;
SO = ValueWhen ( ST , O );
SH = ValueWhen ( ET , HHV ( H, Bar ) );
SL = ValueWhen ( ET , LLV ( L, Bar ) );
SC = ValueWhen ( ET , C );



O1=SO;
H1=SH;
L1=SL;
C1=SC;

bu1 = (C1-L1)+C1;
se2 = C1-(H1-C1);
PP = (H1 + L1 + C1 + O1) / 4 ;
R1 = (2 * PP) - L1;
S1 = (2 * PP) - H1;
R2 = PP + R1 - S1;
S2 = PP + S1 - R1;
R3 = R2 + (R1 - PP);
S3 = S2 - (PP - S1);

Plot (se2,"Sell Pressure",32,4);
Plot (bu1,"Buy Pressure",27,4);
_SECTION_BEGIN("bsp");
Stime =091500;
Etime = 093000;
TN = TimeNum();
ST = TN == Stime ;
ET = TN == Etime ;
BS = ValueWhen ( ST, Cum(1));
BE = ValueWhen ( ET, Cum(1));
Bar = BE - BS;
SO = ValueWhen ( ST , O );
SH = ValueWhen ( ET , HHV ( H, Bar ) );
SL = ValueWhen ( ET , LLV ( L, Bar ) );
SC = ValueWhen ( ET , C );



O1=SO;
H1=SH;
L1=SL;
C1=SC;

bu1 = (C1-L1)+C1;
se2 = C1-(H1-C1);
PP = (H1 + L1 + C1 + O1) / 4 ;
R1 = (2 * PP) - L1;
S1 = (2 * PP) - H1;
R2 = PP + R1 - S1;
S2 = PP + S1 - R1;
R3 = R2 + (R1 - PP);
S3 = S2 - (PP - S1);
Plot (se2,"Sell Pressure",32,styleDashed);
Plot (bu1,"Buy Pressure",27,styleDashed);
 

Attachments

Last edited:
Hi
I would like to create simple afl code with exploration.My set up is EMA 5 & 13,slandered macd & rsi.EMA crossover of 5 from below & MACD above 0 line ,rsi above 50 is Buy & vice verse.Pl. help.
 

sr114

Well-Known Member
Hi
I would like to create simple afl code with exploration.My set up is EMA 5 & 13,slandered macd & rsi.EMA crossover of 5 from below & MACD above 0 line ,rsi above 50 is Buy & vice verse.Pl. help.
exploration afl code
Code:
_SECTION_BEGIN("Buy Sell Exploration ");
MA_5= EMA(C,5);
MA_13=EMA(C,13);

MACD_e=MACD(12,26);

RSI_e=RSI(14);

Buy =  Cross(MA_5,MA_13) AND MACD_e>0 AND RSI_e>50;
Sell=   Cross(MA_13,MA_5) AND MACD_e<0 AND RSI_e<50;

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBrightGreen,0,L,-20); 
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-20);
Plot(C,"Close",colorGrey40,64);
Plot(MA_5,"",colorBlue,1);
Plot(MA_13,"",colorred,1);


_SECTION_END();

_SECTION_BEGIN("Explorer");
if(Status("action") == actionExplore)
{
	Filter = (Buy OR Sell) ;
		SetOption("NoDefaultColumns", True);
		AddTextColumn(Name(), "SYMBOL");
		AddColumn(DateTime(), "DATE", formatDateTime,colorBlue);
		AddColumn(IIf(Buy, 66, 83), "TRIG", formatChar, colorwhite, IIf(Buy, colordarkGreen, colorred));
		AddColumn(C, "CMP", 1, colorBlue);
		AddColumn(MA_5, "EMA5", 1, colorwhite,IIf(MA_5 > Ref(MA_5,-1), colordarkGreen, colorred));
		AddColumn(MA_13, "EMA13", 1, colorwhite,IIf(MA_13 > Ref(MA_13,-1), colordarkGreen, colorred));
		AddColumn(MACD_e, "MACD", 1, colorwhite,IIf(MACD_e > 0, colordarkGreen, colorred));
		AddColumn(RSI_E, "RSI", 1, colorwhite,IIf(RSI_e > 50, colordarkGreen, colorred));

		

        
    }
_SECTION_END();
rgds
 
Last edited:
Anybody with the idea I had posted regarding how to write a GetBaseIndex() like function but for a "level up" index? I have MorningStar Index tickers from TC2k MGxxx in which when the last (third) "x" is a 0, it represents the Sector Index given by the number of the second "x" that represents the Industry Index that can be naturally retrieved with the GetBaseIndex() internal function.
Example:

GetBaseIndex() for "Major Integrated Oil & Gas" Industry will retrieve from MG121 ticker, but this is associated with the MG120 Sector which is Energy which would be nice to be retrieved with a GetSectorIndex(GetBaseIndex()) custom function.

Thanks in Advance Sirs!
 
Hi seniors,

I trade with zerodha, they have released a new trading platform called "Pi" which can be bridged with amibroker for semi auto trading. i use an afl with which i trade manually. can any seniors help in bridging Pi & amibroker. they say some codes need to be written. I am not an programmer & i dont understand coding. Any help would be very useful if somebody willing i will give complete details.

Aman ,
ZERODHA already officially Released Final PI version ? - or is it a BETA Release ?curious bcos v havnt recvd any info on this from them.

Edit: No not Yet- its a Beta Release (Final BETA Release according to Z-connect)
 
Last edited:
Hello all,

I have used inhourly in get TimeFrameGetPrice


When we check code check and profile,it says "It seems that the formula does not reference future quotes.
This is good.

BUT

When we do bar check , it changes from buy signal to sell signal

What is the problem?
 

Similar threads