Simple Coding Help - No Promise.

When backtesting only partial data is being used by Amibroker, how to correct it so that all the data is backtested in one go.

Eg:
IEOD Data already imported into Amibroker: from Jan 2007 to Dec 2013
On backtesting for all quotes it only shows trades from Jan 2007 till Dec 2007.
I have to backtest again starting from Dec 2007 till date for which it shows trades till Nov 2013 & so on...
Bhaiya usko jayada Paise do . . . :D

One of the reasons can be that all the capital gets exhausted . . . increase the capital or limit the number of shares being bot/sold

Try using in the AFL

Code:
SetPositionSize(1,4);
:) Happy
 

mastermind007

Well-Known Member
sir I have


1. J. M. Hurst - The Profit Magic Of Stock Transaction Timing Size 8 MB
2. Cyclic.Analysis_.A.Dynamic.Approach.to.T.J.M.Hurst Size 6.5 MB
3. Ch. Grafton - Mastering Hurst Cycles Size 22.3 MB

I can send you by email or 4shared link, please let me know which one you want ?
Neha,

Check ur PM
 

amibrokerfans

Well-Known Member
hello members

anyone have/created "Lomb Periodogram" formula for amibroker?
currently it available on wave59 and saw a version on tradestation also..
but till now nothing for amibroker...
 

mastermind007

Well-Known Member
Nehal

Here is a code that plots look alike of Hurst Channels and they too have a Ref variable with forward and backward looking points

Hurst Philosophy followed with this indicator is hinged upon importance of Sigma....

Line closest to the CMP is 1st sigma. one next to it is 2 sigma and so on ....

Probability of reversal increases as prices reaches higher sigmas

Entire probability of reversal is dictated by standard bell distribution curve...

Search for youtube videos by Jan Arps...

Here is AFL.

Code:
Plot( Close, "Price", colorBlack, styleCandle );
period = 25;

halfperiod = floor( period /2 );
// minor term average
Arm = MA( Close, period );
Plot( Arm, "Minor term avg", colorRed );

// calculate volatility
yom = 100 * ( C - Ref( Arm, -halfperiod ))/Ref( Arm, -halfperiod );
avyom = MA( yom, 2 * period );
varyom = MA( yom * yom, 2 * period ) - avyom * avyom;
som = Ref( sqrt( varyom ), -halfperiod );
sigma= MA( som, period );

// plot reference price grid
Plot( Arm * ( 1 + 0.01 * sigma ), "Ch+1", colorLightGrey );
Plot( Arm * ( 1 - 0.01 * sigma ), "Ch-1", colorLightGrey );
Plot( Arm * ( 1 + 0.02 * sigma ), "Ch+2", colorLightGrey );
Plot( Arm * ( 1 - 0.02 * sigma ), "Ch-2", colorLightGrey );
Plot( Arm * ( 1 + 0.03 * sigma ), "Ch+3", colorLightGrey );
Plot( Arm * ( 1 - 0.03 * sigma ), "Ch-3", colorLightGrey );
 

amitrandive

Well-Known Member
Hello

All in one Moving Average

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();

_SECTION_BEGIN("SUPER_MA");
R1 = Param("RATIO EMA",1,0,10,1);
R2 = Param("RATIO DEMA2",2,0,10,1);
R3 = Param("RATIO TEMA",3,0,10,1);
R4 = Param("RATIO WMA", 4,0,10,1);
R5 = Param("RATIO HMA", 4,0,10,1);
R6 = Param("RATIO MA",  3,0,10,1);
R7 = Param("RATIO Wilder",2,0,10,1);
R8 = Param("RATIO LinReg",1,0,10,1);

s = R1+R2+R3+R4+R5+R6+R7+R8;

function SuperMA(P, n) 
{ 
	m1	=	EMA(P,n);		m2	=	DEMA(P,n);		m3	=	TEMA(P,n);	
	m4	=	WMA(P,n);		m5	=	HMA(P,n);		m6	=	MA(P,n);	
	m7	=	Wilders(P,n);		m8	=	LinearReg(P,n);

	m  = (R1*m1+R2*m2+R3*m3+R4*m4+R5*m5+R6*m6+R7*m7+R8*m8)/s;	

   return m; 
} 


Len  = Param("PERIOD",30,2,90,1);

SMA_C = SuperMA(C,Len);	SMA_O = SuperMA(O,Len);
SMA_H = SuperMA(H,Len);	SMA_L = SuperMA(L,Len);
Col = IIf(SMA_C > SMA_O,colorBlue,colorRed);
Plot(SMA_H,"SMA_H",Col,styleThick);	
Plot(SMA_L,"SMA_L",Col,styleThick);

_SECTION_END();

Adjust the ratios, to get your type of curve, you can also select ratio as zero, if you want to suppress the effect for that type of MA



:) Happy
Happy Singh

This is fantastic , Thanks !!!:clap:
 

VJAY

Well-Known Member
Dear happy singh/Pratap,
Can you please give code for VWAP ...I want to show it on current day(current day vwap) chart only...means not want it in all prevdays charts...next day no need to show yday line on chart...
 

dell

Well-Known Member
i am trading in 15m tf with a system in which multitf support is taken from daily ...............
now i apply same system on 5m tf .............and i need that signal of 15m tf to be shown in 5m tf ................it may be inform of a ribbon also .........or in shapes also.............is here also gfx function is use or any other function ............
how it can be done .............any reference link plz ..............
 
Hope this helps
Code:
_SECTION_BEGIN("VWAP_SD");
/////  VWAP and  SDs /////
ND = Day() != Ref(Day(), -1);
P = (H + L+C) / 3;
VWP = P * V;
BI = BarIndex();
BeginBI = ValueWhen(ND, BI);
BeginBI = BeginBI[BarCount -1];
if(BeginBI < BarCount - 1)
 {
 InRange = BI >= BeginBI;
 CumV = Cum(V * InRange);
 CumVWP = Cum(VWP * InRange);
  VWAP = CumVWP / CumV;
 S = Cum(Ref(CumV, -1) * V * (P - Ref(VWAP, -1))^2 / CumV);
 Variance = S / CumV;
  SD = sqrt(Variance);
  VWAP = IIf(InRange,  VWAP, Null);
 Plot(VWAP, "VWAP", colorYellow, styleNoTitle + styleNoRescale);
 Plot(VWAP +  SD, "+1SD", colorGreen, styleDashed + styleNoTitle + styleNoRescale);
 Plot(VWAP -  SD, "-1SD", colorRed, styleDashed + styleNoTitle + styleNoRescale);
 Plot(VWAP + 2*SD, "+2SD", colorSeaGreen, styleDashed + styleNoTitle + styleNoRescale);
 Plot(VWAP - 2*SD, "-2SD", colorOrange, styleDashed + styleNoTitle + styleNoRescale);
 Plot(VWAP + 3*SD, "+3SD", colorPaleGreen, styleDashed + styleNoTitle + styleNoRescale);
 Plot(VWAP - 3*SD, "-3SD", colorBrown, styleDashed + styleNoTitle + styleNoRescale);
 }
_SECTION_END();
Dear happy singh/Pratap,
Can you please give code for VWAP ...I want to show it on current day(current day vwap) chart only...means not want it in all prevdays charts...next day no need to show yday line on chart...
 

Nehal_s143

Well-Known Member
first you need to convert the indicator using time frame restore method for 15m tf and then use the same as you desire in 5 min....


i am trading in 15m tf with a system in which multitf support is taken from daily ...............
now i apply same system on 5m tf .............and i need that signal of 15m tf to be shown in 5m tf ................it may be inform of a ribbon also .........or in shapes also.............is here also gfx function is use or any other function ............
how it can be done .............any reference link plz ..............
 

Similar threads