Simple Coding Help - No Promise.

Dawood

Active Member
breakoutime = 103000;
NewDay = Day()!= Ref(Day(), -1);
H1=HighestSince(newday,H,1);
L1=LowestSince(newday,L,1);

C1 =?

Need closing price before 10.30 bar(first 75min bar only)...please help

Means high low close of first 75min bar only from 9.15 to 10.30
 
Last edited:

Nehal_s143

Well-Known Member
hAPPY sINGH JI I HAVE POSTED AN AFL AND REQUEST YOU TO SOLVE THAT. WHAT HAPPENED.
This thread is great & priceless help from seniors, no body is bind here to help or reply, please use soft language, we can not order here, its no body duty to help, its humbleness of seniors to support the learners....like me and others

please be kind and humble when you post request, Jayadevm my intention is not hurt you....
 

amitrandive

Well-Known Member
HOW TO KEEP THE BUY CANDLE CONSTANT ONCE IT APPEARED..


PLS CHECK THE FOLLOWING CODE in post #3389..


Prob is..

ONCE THE BUY/SHORT APPEARS, IT KEEPS MOVING TILL THE TIME FURTHER NEW HIGHS/NEW LOWS ARE MADE..
PLs try copying the code in Ami and my prob statement will be easier to understand!!
Thank u for the correction.. Hope this is fine..

Thanks shirajroz

Pls look after the continuous changing buy/short arrows in the code attached..

Will delete that code from the post!!

Code:
_SECTION_BEGIN("Price");
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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();




H1 = TimeFrameGetPrice("H", inDaily); // Today's high
L1 = TimeFrameGetPrice("L", inDaily); // Today's low
Plot(H1, "",colorBrightGreen,styleDashed);
Plot(L1, "",colorDarkRed,styleDashed);

Buy = High >= Ref(H1,-1);
Short = Low <= Ref(L1 ,-1) ;

Sell =  Short;
Cover =  Buy;

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



PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-25);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-35); 
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-30);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=25);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=35); 
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-30);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorRed, 0, L, Offset=-15);
PlotShapes(IIf(Cover, shapeStar, shapeNone),colorGold, 0,L, Offset=-15);
Buy and Sell is based on today's high and low.
So the arrows will keep on changing as today's high low keeps on changing till market closes for the day.
 

amitrandive

Well-Known Member
breakoutime = 103000;
NewDay = Day()!= Ref(Day(), -1);
H1=HighestSince(newday,H,1);
L1=LowestSince(newday,L,1);

C1 =?

Need closing price before 10.30 bar(first 75min bar only)...please help

Means high low close of first 75min bar only from 9.15 to 10.30
This should work.Adjust breakout time from the parameters

Code:
BT = ParamTime ("Open Breakout Time", "09:15");
afterbreakout0 = Cross(TimeNum(),BT);
afterbreakout1 = TimeNum()>=BT;
NewDay = Day()!= Ref(Day(), -1);
highestoftheday = HighestSince(newday,H,1);
Lowestoftheday =LowestSince(newday,L,1);
Closeoftheday=valuewhen(timenum()==103000,C);
ORBH = ValueWhen(afterbreakout0,highestoftheday,1);
ORBL = ValueWhen(afterbreakout0,lowestoftheday,1);
ORBC = Closeoftheday;
Plot(ORBH,"",colorGreen,styleDots);
Plot(ORBL,"",colorYellow,styleDots);
Plot(ORBC, "", colorAqua, styleDots);
Plot ( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
 
Friends,

I am looking for an exploration afl to find the breakout / breakdown of a stock from day's high and low as it happens.

Please share the afl if anyone of you have.

Thanks,
Ashish
 
Friends,

Attached is the VWAP code.

HTML:
 _SECTION_BEGIN("VWAP");
/*
The VWAP for a stock is calculated by adding the dollars traded for every
transaction in that stock ("price" x "number of 
      shares traded") and dividing the total shares traded. A VWAP is computed
from the Open of the market to the market Close, AND is 
      calculated by Volume weighting all transactions during this time period
*/

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 093000, BarIndex());
TodayVolume = Sum(V,Bars_so_far_today);
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_today  ) /
TodayVolume,0);
Plot (VWAP,"VWAP",colorOrange, styleThick);

_SECTION_END();
Is it possible for anyone to include VWAP bands in this code.
VWAP bands should be 1% and 2% standard deviation on each side of VWAP band.
Also, it would be useful if VWAP band's standard deviation can be changed in parameters.
 

amitrandive

Well-Known Member
Friends,

Attached is the VWAP code.

HTML:
 _SECTION_BEGIN("VWAP");
/*
The VWAP for a stock is calculated by adding the dollars traded for every
transaction in that stock ("price" x "number of 
      shares traded") and dividing the total shares traded. A VWAP is computed
from the Open of the market to the market Close, AND is 
      calculated by Volume weighting all transactions during this time period
*/

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 093000, BarIndex());
TodayVolume = Sum(V,Bars_so_far_today);
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_today  ) /
TodayVolume,0);
Plot (VWAP,"VWAP",colorOrange, styleThick);

_SECTION_END();
Is it possible for anyone to include VWAP bands in this code.
VWAP bands should be 1% and 2% standard deviation on each side of VWAP band.
Also, it would be useful if VWAP band's standard deviation can be changed in parameters.
Pratap Sir has already done that, no need to reinvent the wheel

http://www.traderji.com/advanced-tr...-combining-trend-vwap-ranges.html#post1071260
 

Similar threads