Simple Coding Help - No Promise.

Hi Happy,

I need a small help to code this afl.

I need to export data from Amibroker with this logic:
function(ticker,date,timeto,timefrom) - where timeto and timefrom are optional
{
for this "ticker", export data for date mentioned to some d:drive or c:drive in this manner
1) if entered datefrom is not trading day, reference to previous "trading" day and export all data of only previous trading day at 1 min timeframe.
2) if current date = entered datefrom, export only last 1 hour of data from current time at "1 min" level.
3) if timefrom and timeto given with datefrom, then export only selected timerange data at 1min level.
4) if timeto and timefrom given with datefrom and dateto, then export datefrom:timefrom to dateto:timeto range at 1 min.
}

Regards,
Sandeep
 
Thanks systrader...thanks to all :clapping: that everybody have already discussed everything which I want except above topic....so thought of giving a try.

I am just trying to bring my Amibroker database to cloud..

Happy, a correction in above post.

function(ticker,datefrom,dateto,timeto,timefrom) - where dateto, timeto and timefrom are optional
 
Friends & Seniors,
is it possible to throw alert in amibroker
like the alert in mt4 system.
ie say we have 2 charts (say of gold and silver) open in tabs, and we are watching silver chart at one time,
is it possible an alert for the chart for gold that we are not watching.

is there any way/method?

thanks in advance.

~ manoj
 
//ScalperHighLow Bracket By JRA Jan 2015
HX=Ref(H,-1);
LX=Ref(L,-1);
TicksOffset= Param("TicksOffset",0.0001,0.0001,0.50,0.0001);//NofTicksAboveorBelow
y0=LastValue(HX)+TicksOffset;
y1=LastValue(LX)-TicksOffset;
Offset = 2;
for(i=BarCount-2;i>1;i--)
{
bars = i;
i = 0;
}
Plot(LineArray(bars-Offset, y0, BarCount, y0,1), "", colorDarkRed, styleLine|styleLine|stylenolabel, Null, Null, Offset);
Plot(LineArray(bars-Offset, y1, BarCount, y1,1), "", colorDarkRed, styleLine|styleLine|stylenolabel, Null, Null, Offset);
for (i=bars; i <BarCount;i++)
{
if (C>y0)
color=colorblue;
else
color = Null;
PlotText(""+Y0, BarCount+1,Y0,Null,color);
AlertIF( C>y0, "SOUND C:\\Windows\\Media\\ringout.wav", "Audio alert", 1 );
}
for (i=bars; i <BarCount;i++)
{
if (C<y1)
color=colorred;
else
color = Null;
PlotText(""+Y1, BarCount+1,Y1,Null,color);
AlertIF( C<y1, "SOUND C:\\Windows\\Media\\ringout.wav", "Audio alert", 1 );
}

dear all this afl is high low of previous candle can any one add buy sell signal in high low breakout. buy signal is wheh candle cross above high and vice versa for sell signal
thanks

pls help
 
1. I have written an afl code based on WOODIES Pivots.
2. The Pivot Point (PP) is calculated on daily data.
3. The levels are plotted on 5 min RT chart in Amibroker.
4. Now I want this code to use in Real Time scan to identify those scrips whose current value cross the PP.
5. Thus suitable Buy-Sell code is to be added but this Buy sell must be based on 5 min data crossing PP.
6. The code is given below.
7. kind help me.

_SECTION_BEGIN("Price");

TimeFrameSet(inDaily);

PP=(Ref(H,-1)+Ref(L,-1)+(2*O))/4;

R1 = (2 * PP) - Ref(L,-1);
R3 = Ref(H,-1) + 2 * (PP - Ref(L,-1));
R2 = PP + (Ref(H,-1)-Ref(L,-1));

S1 = (2 * PP) - Ref(H,-1);
S2 = PP - (Ref(H,-1)-Ref(L,-1));
S3 = Ref(L,-1) - 2 * (Ref(H,-1) - PP);

Plot(EndValue(R1),"\n\nR1",colorRed,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(R2),"\nR2",colorRed,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(R3),"\nR3",colorRed,styleLine|styleThick,Null,0,0,5);

Plot(EndValue(PP),"\n\nPIV",colorBlue,styleLine|styleThick,Null,0,0,5);

Plot(EndValue(S1),"\n\nS1",colorGreen,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(S2),"\nS2",colorGreen,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(S3),"\nS3",colorGreen,styleLine|styleThick,Null,0,0,5);

TimeFrameRestore();
_SECTION_END();
 

amitrandive

Well-Known Member
1. I have written an afl code based on WOODIES Pivots.
2. The Pivot Point (PP) is calculated on daily data.
3. The levels are plotted on 5 min RT chart in Amibroker.
4. Now I want this code to use in Real Time scan to identify those scrips whose current value cross the PP.
5. Thus suitable Buy-Sell code is to be added but this Buy sell must be based on 5 min data crossing PP.
6. The code is given below.
7. kind help me.

_SECTION_BEGIN("Price");

TimeFrameSet(inDaily);

PP=(Ref(H,-1)+Ref(L,-1)+(2*O))/4;

R1 = (2 * PP) - Ref(L,-1);
R3 = Ref(H,-1) + 2 * (PP - Ref(L,-1));
R2 = PP + (Ref(H,-1)-Ref(L,-1));

S1 = (2 * PP) - Ref(H,-1);
S2 = PP - (Ref(H,-1)-Ref(L,-1));
S3 = Ref(L,-1) - 2 * (Ref(H,-1) - PP);

Plot(EndValue(R1),"\n\nR1",colorRed,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(R2),"\nR2",colorRed,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(R3),"\nR3",colorRed,styleLine|styleThick,Null,0,0,5);

Plot(EndValue(PP),"\n\nPIV",colorBlue,styleLine|styleThick,Null,0,0,5);

Plot(EndValue(S1),"\n\nS1",colorGreen,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(S2),"\nS2",colorGreen,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(S3),"\nS3",colorGreen,styleLine|styleThick,Null,0,0,5);

TimeFrameRestore();
_SECTION_END();
Try this Scan on a periodicity of 5 min

Code:
_SECTION_BEGIN("Price1");
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();

_SECTION_BEGIN("Price");

TimeFrameSet(inDaily);

PP=(Ref(H,-1)+Ref(L,-1)+(2*O))/4;

R1 = (2 * PP) - Ref(L,-1);
R3 = Ref(H,-1) + 2 * (PP - Ref(L,-1));
R2 = PP + (Ref(H,-1)-Ref(L,-1));

S1 = (2 * PP) - Ref(H,-1);
S2 = PP - (Ref(H,-1)-Ref(L,-1));
S3 = Ref(L,-1) - 2 * (Ref(H,-1) - PP);

Plot(EndValue(R1),"\n\nR1",colorRed,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(R2),"\nR2",colorRed,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(R3),"\nR3",colorRed,styleLine|styleThick,Null,0,0,5);

Plot(EndValue(PP),"\n\nPIV",colorBlue,styleLine|styleThick,Null,0,0,5);

Plot(EndValue(S1),"\n\nS1",colorGreen,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(S2),"\nS2",colorGreen,styleLine|styleThick,Null,0,0,5);
Plot(EndValue(S3),"\nS3",colorGreen,styleLine|styleThick,Null,0,0,5);

TimeFrameRestore();
_SECTION_END();
Buy=Cross(C,PP);
Sell=Cross(PP,C);
PlotShapes (IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0,Graph0,-15);
PlotShapes (IIf(Sell,shapeDownArrow,shapeNone),colorCustom12,0,Graph0,-15);
BuyPrice=ValueWhen(Buy, C);
SellPrice=ValueWhen(Sell, C);
Filter=Buy OR Sell ;

                SetOption("NoDefaultColumns", True);
                AddTextColumn(Name(), "Symbol", 77, colorDefault, colorDefault, 120);
                AddColumn(DateTime(), "Trigger Date", formatDateTime);
                 AddColumn(IIf(Buy, 66, 83), "Signal", formatChar, colorYellow, IIf(Buy, colorGreen, colorRed));
               AddColumn(IIf(Buy, BuyPrice, SellPrice),  "Entry", 6.2);
               AddColumn(LastValue(C), "Entry Price.", 6.2);
 
Hello traders,

Adding to this thread..

Would anyone know how to create an indicator that would return a value
relative to the moving average.
Example 1:
Say current price = 50, 21 period EMA = 45. Value returned = 5 (50-45)

Example 2:
Say current price = 50, 21 period EMA = 52. Value returned = -2 (50-52)

thanks
Mathew
 

Similar threads