please Help....

arora

Well-Known Member
#1
can somebody please explain me in english, In This Code(mentioned below) what conditions writer is using to make entry and exit, please help on what conditions writer has designed to make entry and exit.

_SECTION_BEGIN("Price");

SetBarsRequired(100000,0);
GraphXSpace = 15;
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkColor(ParamColor("bkcolor",ColorRGB(0,0, 0)));
GfxSetBkMode(0);
GfxSetOverlayMode(1);
//SetTradeDelays(1,1,1,1);
SetPositionSize(100,spsShares);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

_SECTION_END();
NHours=Param("Number of Hours",30,1,50,1);
HoursC=TimeFrameGetPrice("O",inHourly,0);
NHoursDHLAvg=0;
for(i=1;i<=NHours;i++)
{
HourH=TimeFrameGetPrice("H",inHourly,-i);
HourL=TimeFrameGetPrice("L",inHourly,-i);
NHoursDHLAvg=NHoursDHLAvg+(HourH-HourL);
}
NHoursDHLAvg=NHoursDHLAvg/NHours;

TenDHLAvg= NHoursDHLAvg;

Buy= C>((HoursC)+((0.618)*(TenDHLAvg)));
Sell= C<((HoursC)-((0.618)*(TenDHLAvg)));

Cover= C>((HoursC)+((0.382)*(TenDHLAvg)));
Short= C<((HoursC)-((0.382)*(TenDHLAvg)));

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

BuyPrice=ValueWhen(Buy,C);
SellPrice=ValueWhen(Sell,C);
ShortPrice=ValueWhen(Short,C);
CoverPrice=ValueWhen(Cover,C);

PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorDarkRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorDarkRed, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-40);
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorGreen, 0,L, Offset=-50);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
SetPositionSize(300,spsShares);

ApplyStop(0,1,10,1);
//-----------end--------------
Long=Flip(Buy,Short);
Shrt=Flip(Sell,Cover);

Edc=(
WriteIf (Buy , " BUY at "+C+" ","")+
WriteIf (Sell, " SEll at "+C+" ","")+
WriteIf (Cover , " Sell Stop at "+C+" ","")+
WriteIf (Short , " Buy Stop at "+C+" ","")
);
_SECTION_END();

BarColors =
IIf(BarsSince(Buy) < BarsSince(Short)
AND BarsSince(Buy)!=0, colorGreen,
IIf(BarsSince(Sell) < BarsSince(Cover)
AND BarsSince(Sell)!=0, colorRed, colorWhite));

//Plot the Candlestick charts
Plot(C, "Close", BarColors, styleNoTitle | ParamStyle("Style") | GetPriceStyle() ) ;

for( i = 0; i < BarCount; i++ )
{
//if( Buy ) PlotText( "BUY@" + C[ i ], i, C[ i ], colorWhite, colorBlue );
//if( Sell ) PlotText( "SELL@" + C[ i ], i, C[ i ], colorWhite, colorViolet );
// if( Cover ) PlotText( "Sell Stop@" + C[ i ]+ "\nSell Profit= " + ((SellPrice-CoverPrice)), i, L[ i ]-3, colorLightGrey, colorBlack );
//if( Short ) PlotText( "BuyStop@" + C[ i ]+ "\nBuy Profit= " + ((ShortPrice-BuyPrice)), i, H[ i ]+3, colorLightGrey, colorBlack );

}

_SECTION_BEGIN("Background text");
C11=ParamColor("up panel",colorBlack );
C12=ParamColor("dn panel",colorBlack );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",12,1,20,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSetOverlayMode(1);
GfxGradientRect(0,0,pxwidth, pxheight, C11, C12 );
GfxSelectFont("Tahoma", Status("pxheight")/C13 );
GfxSetTextColor(colorBrown);
GfxSetTextAlign( 6 );
//GfxTextOut( "LTP "+WriteVal(C,1.2), Status("pxwidth")/C14, Status("pxheight")/C15);
GfxSelectFont("Tahoma", Status("pxheight")/C13*0.5 );
GfxSetTextColor(colorBrown);
GfxSelectFont("Tahoma", 20, 800, False, False, 0);
GfxSetTextColor(colorYellow);
GfxTextOut(""+edc+"", Status("pxwidth")/1.15, Status("pxheight")/C15*0.3 );



please help........
 

arora

Well-Known Member
#4
behind the code are Hours science

Hours= Open + ( (High-Low) / 30Hours ) // <<< TimeFrame in Hours

Buy= Close>(Hours)
Mr. boufalo

I appreciate your prompt reply. I have to put this code in Excel.

due to reply on other thread from mastermind
I understand the point that Buy signal comes Close price is above the (Hourly close price + 0.618 * (simple average of (last 30 hourly high - last 30 hourly low))).

It will exit from buy when
Close price is below the (Hourly close price - 0.618 * (simple average of (last 30 hourly high - last 30 hourly low))).



i understand hourly high means High of that particular hour and hourly low is low of that particular hour and hourly close is close of that particular hour.
But not able to understand meaning of last 30 , and calculating its simple average of range(last 30 HH-last30LH)
if you can explain what is last 30 meaning,

i need to put this in excel formula.
thanks
 

arora

Well-Known Member
#5
behind the code are Hours science

Hours= Open + ( (High-Low) / 30Hours ) // <<< TimeFrame in Hours

Buy= Close>(Hours)
what do you mean by 30 hours in your reply?
do i have hh-hl/30?

or
hh-hl/price of 30 day moving average of that particular hour
m i right or wrong?

thanks
 
Last edited:
#7
HI,

the formula is

buy = open +0.618*(high-low)
sell = open - 0.618*(high-low)

open, high and low are first 30 minutes values
 

arora

Well-Known Member
#9
a lot of repainting of buy and sell in that afl trust me it;s not what u need to make money :p just suggestion.
dear, i agree with your point this AFL is of no use, if we follow it blindly i mean signal by signal. but i have my own manual rules as well. like 1. Trend confirmation based upon 15 min with help of RSI. normally traders use RSI for support and resistance i use RSI for trend identification with my own parameters. 2. donchain channel on 1min with my own parameters and entry conditions to reduce Risk. AFL is of no use, but for me still it is of use.
Why i wanted to know logic, because data on amibroker is not reliable. I am not able to find any reliable data provider, everyone data is inconsistent. i want to give logic to icharts so that they will help me to design indicator in silver light platform they have. Icharts data is reliable and legal.

:):)
 
Last edited:
#10
HI,

the formula is

buy = open +0.618*(high-low)
sell = open - 0.618*(high-low)

open, high and low are first 30 minutes values

hi sorry for my delay replay.... now you confuse me too
I will try to write in shorten and sorter version the code
sorry but i canot see average in here. were i am wrong?


Code:
[B]the original code says....[/B]
NHours=Param("Number of Hours",30,1,50,1);
HoursC=TimeFrameGetPrice("O",inHourly,0);
NHoursDHLAvg=0;

for(i=1;i<=NHours;i++)
{
HourH=TimeFrameGetPrice("H",inHourly,-i);
HourL=TimeFrameGetPrice("L",inHourly,-i);
NHoursDHLAvg=NHoursDHLAvg+(HourH-HourL);
}
NHoursDHLAvg=NHoursDHLAvg/NHours;
Buy= C>((HoursC)+((0.618)*(NHoursDHLAvg)));

if we write it shorter is
NHours=30;
NHoursDHLAvg= ZERO+(HourH-HourL)/ 30
Buy= C>((open_inHourly)+((0.618)*(NHoursDHLAvg)));


and then in shorter version is

Buy= C>( open_inHourly +( 0.618*(ZERO+(HourH-HourL)/30) );

or

golden_Ratio * High_Low_Volatility_divide_30Hours = 0.618 * (HourH-HourL)/30;
Buy= C>((open_inHourly) + ( golden_Ratio * High_Low_Volatility_divide_30Hours);


so i canot see average in here please correct me if i am wrong?

@ ashokram1
there is no were in the code timeframeSet() or timeframeGet() 30* inminute so your reply is wrong
 

Similar threads