Simple Coding Help - No Promise.

Hi guys i am gald to be with experts and good knolge helpfull people

and nice to shar idea or what i hope to development by Amibroker

accully tha idea of the indcator developed by Aelxander Elder
It call Bear power and its the differnce between the lowest price of the day and 13 ema standard above or below zero line with scan what is advantage with Amibroker





thank you in advance
 
Hi all seniors,

I'm backtesting buying at 9:30 and selling 11:30 am. I'm not able to pick the "Time" -- it is showing as 0 on the plot and no results are shown on the Analysis page.

Could you please help?

thanks so much!

Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );




Time = TimeNum();
Plot(Time, "Time", colorYellow);



    Buy = (Time == 093000);
    Sell = (Time == 113000);
    
    Buy = ExRem(Buy, Sell);
    Sell = ExRem(Sell, Buy);
    
    BuyPrice = SellPrice = Open;



_SECTION_END();
 
Hi Romeo ji

I need this code for 75 Minutes instead of 15 Minute

nd=(Minute()%15==0);
prh = ValueWhen(nd,TimeFrameGetPrice("H", in15Minute, -1));
prl = ValueWhen(nd,TimeFrameGetPrice("L", in15Minute, -1));
x = 2;

Please modify and post.
Thank you
 

chintan786

Well-Known Member
Hi the following afl code is for plotting of Low Volume bar Hi/Low from beginning of the day. But i want from beginning of the day only from when previous candle volume is less than the present candle. i have tried so many ways but could not succed .please any one ... thanks in advance....

_SECTION_BEGIN("VK LVB");
n=Day() != Ref(Day(), -1);
a=lowestSince(n,V);
hh=ValueWhen(V==a,H);
ll=ValueWhen(V==a,L);
hr = ValueWhen(V==a,Hour());
mn = ValueWhen(V==a,Minute());
plot(hh,"\nLVhb ",coloryellow,styleDashed);
Plot(ll,"\nLVlb @ ("+hr+" : "+mn+") ",colorblue,styleDashed);
PlotOHLC(ll,hh,ll,hh,"",colorBlack,styleCloud|stylenotitle,0,0,0,-2);
_SECTION_END();



Regards
Mano
Hi, try this. u can add below code to your afl. see if it serves your purpose
Code:
kt = V >  Ref(V,-1) AND AlmostEqual((Ref(V,-1)) ,  LowestSince(n,V));

ktl = ValueWhen(kt, L);

ktz = Cross (ktl,C) AND C < o;
PlotShapes(IIf(ktz, shapeDownArrow, shapeNone),colorYellow, 0, H, Offset=-90);
 

chintan786

Well-Known Member
Hi Romeo ji

I need this code for 75 Minutes instead of 15 Minute

nd=(Minute()%15==0);
prh = ValueWhen(nd,TimeFrameGetPrice("H", in15Minute, -1));
prl = ValueWhen(nd,TimeFrameGetPrice("L", in15Minute, -1));
x = 2;

Please modify and post.
Thank you
Chintan 786 ji please do me this favor
u sharing small part of whole code. please share complete code to understand what u want to plot in chart.
 
Hi seniors
Already I asked for help with code. But that code was of Varun sir CRB code . I tried to get that period for 75 minutes which is enable for 15 minute hour and day

Now I need a favor. This code I got from Tradingview. Want to plot this indicator in Amibroker. Experts please do this if possible.


indicator("Nadaraya-Watson Envelope [LuxAlgo]",overlay=true,max_bars_back=1000,max_lines_count=500,max_labels_count=500)
length = input.float(500,'Window Size',maxval=500,minval=0)
h = input.float(8.,'Bandwidth')
mult = input.float(3.)
src = input.source(close,'Source')

up_col = input.color(#39ff14,'Colors',inline='col')
dn_col = input.color(#ff1100,'',inline='col')
disclaimer = input(false, 'Hide Disclaimer')
//----
n = bar_index
var k = 2
var upper = array.new_line(0)
var lower = array.new_line(0)
lset(l,x1,y1,x2,y2,col)=>
line.set_xy1(l,x1,y1)
line.set_xy2(l,x2,y2)
line.set_color(l,col)
line.set_width(l,2)
if barstate.isfirst
for i = 0 to length/k-1
array.push(upper,line.new(na,na,na,na))
array.push(lower,line.new(na,na,na,na))
//----
line up = na
line dn = na
//----
cross_up = 0.
cross_dn = 0.
if barstate.islast
y = array.new_float(0)

sum_e = 0.
for i = 0 to length-1
sum = 0.
sumw = 0.

for j = 0 to length-1
w = math.exp(-(math.pow(i-j,2)/(h*h*2)))
sum += src[j]*w
sumw += w

y2 = sum/sumw
sum_e += math.abs(src - y2)
array.push(y,y2)
mae = sum_e/length*mult

for i = 1 to length-1
y2 = array.get(y,i)
y1 = array.get(y,i-1)

up := array.get(upper,i/k)
dn := array.get(lower,i/k)

lset(up,n-i+1,y1 + mae,n-i,y2 + mae,up_col)
lset(dn,n-i+1,y1 - mae,n-i,y2 - mae,dn_col)

if src > y1 + mae and src[i+1] < y1 + mae
label.new(n-i,src,'▼',color=#00000000,style=label.style_label_down,textcolor=dn_col,textalign=text.align_center)
if src < y1 - mae and src[i+1] > y1 - mae
label.new(n-i,src,'▲',color=#00000000,style=label.style_label_up,textcolor=up_col,textalign=text.align_center)

cross_up := array.get(y,0) + mae
cross_dn := array.get(y,0) - mae
alertcondition(ta.crossover(src,cross_up),'Down','Down')
alertcondition(ta.crossunder(src,cross_dn),'Up','Up')
//----
var tb = table.new(position.top_right, 1, 1
, bgcolor = #35202b)
if barstate.isfirst and not disclaimer
table.cell(tb, 0, 0, 'Nadaraya-Watson Envelope [LUX] Repaints'
, text_size = size.small
, text_color = #cc2f3c)
 

Similar threads