plz add exploration and backtest lines

labdhi

Active Member
#1
plz add exploration code and backtesting lines in this code , will be thankful to u .....................also if any one here can explain me what is this all about :sos::!

_SECTION_BEGIN("dhamal");

netbull= Sum(C<Ref(C,-1),3)==3;
netbear= Sum(C>Ref(C,-1),3)==3;

NLBL= ValueWhen(netbull,Ref(H,-2));
NLSL= ValueWhen(netbear,Ref(L,-2));

netline=IIf(BarsSince(NLBL)<BarsSince(NLSL),NLBL, NLSL);

Plot(IIf(Ref(C,-1)< NLBL,NLBL,Null),"NLBL",colorLime,styleDots|styleNoLine|styleThick);
Plot(IIf(Ref(C,-1)> NLSL,NLSL,Null),"NLSL",colorRed,styleDots|styleNoLine|styleThick);

Couleur= IIf(C> NLBL, colorBlue, IIf(C<NLSL, colorRed, colorBlack));
Plot( C, "Close", couleur, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


Buy= Cross(C,NLBL);
Sell= Cross(NLSL,C);

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
//Short = ExRem(Short, Cover);
//Cover = ExRem(Cover, Short);
AlertIf( Buy, "", "BUY @ " + C, 1 );
AlertIf( Sell, "", "SELL @ " + C, 2 );

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

//Plot( Close, "Price", colorBlack, styleCandle );

PlotShapes( shape, IIf( Buy, colorBlue, colorRed ), 0, IIf( Buy, Low, High ) );



dist = 0.5*ATR(10);
dist1 =1*ATR(10);
//SLB = LLV(L,swingN);
//SLS = HHV(H,swingN);
sup=LLV(L,10);
res=HHV(H,10);

/*
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);

tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
*/


for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
//PlotText( "\nBuy:" + H[ i ] + "\nRisk= " + (H-sup) + "\nSL= " + (sup), i, L[ i ]-dist, colorGreen, colorWhite );
PlotText( "\n" + H[ i ] + "(R)" + (H-sup) , i, L[ i ]-dist, colorWhite, colorBlue );

}


if( Sell )
{
PlotText( "" + L[ i ] + "(R)" + ((res-L)) , i, H[ i ]+dist1, colorWhite, colorPlum );
}
}


_SECTION_END();

_SECTION_BEGIN("wtesttrend");
r1 = PDI(14);
r2 = MDI (14);


Period = Param("Period",20,1,100,1);
TI = WMA( 2*WMA((r1-r2),int(Period/2))- WMA((r1-r2),Period),int(sqrt(Period)));



for( i = 1 ; i < BarCount-2; i++ )
{
if (TI <TI[i-1] &&TI <TI[i+1])
Lpml=1;
else
Lpml =0;

if (TI >TI[i-1] &&TI >TI[i+1])
Lpmh=1;
else
Lpmh =0;
}

GR =ExRem(LpmH,Lpmh);
RD =ExRem(Lpml,Lpml);

Plot( TI, _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style") );
_SECTION_END();
 

labdhi

Active Member
#3
in amibroker is there any automatic trendline afl , like that one in keystock ? which plots trendlines automatically on charts ............and we can explore the scripts , which r nearing the trendline ......................
 

VJAY

Well-Known Member
#5
Dear labdi,
I think you are still in search of holygrail.....:D
Try to stick in any one method....learn it perfectly...backtest it for confidence....use MM.....start with small.......othervise this searching never stops....don't take othervise...I said it with my own experience ...:)
 
#6
Hi
Labdhi-
it seems you are under emotional hurry.you wanted so many things & so fast.
please Dont think the forum is running away.
you wanted exploration-backtesting-trendline based scan.
Fine.

I ask two simple questions.
1 Have you looked at the method,charts,various instruments and tried to form a ruleset for trading with this?
2.have you tested this a 50 or 100 times? if so what are the results like

if you already have a ruleset,please post.
It is the unconventional clever thinking that goes into making powerful ruleset that makes system a success.

Good trader tests his method without waiting for what others say. he has only one burning question-percent success rate and he never waits for others to tell him -he finds it out himself. if things turn negative during this exercise h rejects the project as a whole.

What about you?

Here is a chart.
The mistake you did may be including TI line plot along with price.

It should be plotted separately.
This method has a winning edge & is ok as it uses support resistance.
Ask yourself
what is priority-indicator or price?
All those who gave priority to indicators are over 80% and they keep loosing.

Caution
sometimes even though TI is going up,price may come down.
Looking at indicator as first priority sinks the boat.
 
Last edited:

labdhi

Active Member
#7
i backtest it manually
on nifty spot data eod
from 15.03.05 upto 03.08.13

total trades 94
total winning trades 40
total loosing trades 54

total amount gained 190400

want to backtest and explorable .............plz help and plz give some filters
 

labdhi

Active Member
#8
Date Trade Entry Exit P/L
15-Mar-05 sell 2122 2031 91
24-May-05 buy 2031 2303 272
9-Aug-05 sell 2303 2387 -84
11-Aug-05 buy 2387 2465 78
22-Sep-05 sell 2465 2464 1
7-Nov-05 buy 2464 3366 902
15-Apr-06 sell 3366 3622 -256
2-May-06 buy 3622 3633 11
12-May-06 sell 3633 2960 673
16-Jun-06 buy 2960 2919 -41
19-Jul-06 sell 2919 3167 -248
27-Jul-06 buy 3167 3351 184
11-Sep-06 sell 3351 3747 -396
27-Oct-06 buy 3747 3948 201
8-Dec-06 sell 3948 4059 -111
12-Jan-07 buy 4059 4044 -15
12-Feb-07 sell 4044 3924 120
13-Apr-07 buy 3924 4102 178
13-Jun-07 sell 4102 4363 -261
3-Jul-07 buy 4363 4424 61
27-Jul-07 sell 4424 4422 2
30-Aug-07 buy 4422 5740 1318
17-Dec-07 sell 5740 6110 -370
27-Dec-07 buy 6110 6142 32
10-Jan-18 sell 6142 5220 922
14-Feb-08 buy 5220 4672 -548
7-Mar-08 sell 4672 4168 504
21-Jul-08 buy 4168 4421 253
14-Aug-08 sell 4421 3152 1269
4-Nov-08 buy 3152 2664 -488
18-Nov-08 sell 2664 2940 -276
10-Dec-08 buy 2940 2888 -52
7-Jan-09 sell 2888 2957 -69
10-Feb-09 buy 2957 2757 -200
17-Feb-09 sell 2757 2836 -79
19-Mar-09 buy 2836 4404 1568
8-Jun-09 sell 4404 4562 -158
9-Jun-09 buy 4562 4332 -230
17-Jun-09 sell 4332 4723 -391
3-Aug-09 buy 4723 4399 -324
10-Aug-09 sell 4399 4743 -344
28-Aug-09 buy 4743 4600 -143
1-Sep-09 sell 4600 4790 -190
7-Sep-09 buy 4790 4829 39
27-Oct-09 sell 4829 4905 -76
9-Nov-09 buy 4905 4806 -99
27-Nov-09 sell 4806 5150 -344
23-Dec-09 buy 5150 5085 -65
21-Jan-10 sell 5085 5147 -62
8-Mar-10 buy 5147 5202 55
28-Apr-10 sell 5202 5203 -1
10-May-10 buy 5203 5349 146
30-Jul-10 sell 5349 5544 -195
19-Aug-10 buy 5544 6056 512
12-Nov-10 sell 6056 6029 27
2-Dec-10 buy 6029 5742 -287
9-Dec-10 sell 5742 6017 -275
24-Dec-10 buy 6017 6022 5
6-Jan-11 sell 6022 5463 559
14-Feb-11 buy 5463 5242 -221
24-Feb-11 sell 5242 5533 -291
1-Mar-11 buy 5533 5348 -185
21-Mar-11 sell 5348 5529 -181
24-Mar-11 buy 5529 5554 25
3-May-11 sell 5554 5571 -17
30-May-11 buy 5571 5475 -96
28-Jul-11 sell 5475 5016 459
30-Aug-11 buy 5016 4911 -105
13-Sep-11 sell 4911 4922 -11
7-Oct-11 buy 4922 5142 220
11-Nov-11 sell 5142 5062 80
2-Dec-11 buy 5062 4673 -389
15-Dec-11 sell 4673 4773 -100
3-Jan-12 buy 4773 4728 -45
4-Jan-12 sell 4728 4855 -127
10-Jan-12 buy 4855 5268 413
27-Jan-12 sell 5268 5421 -153
12-Mar-12 buy 5421 5305 -116
16-Mar-12 sell 5305 5010 295
6-Jun-12 buy 5010 5217 207
12-Jul-12 sell 5217 5293 -76
6-Aug-12 buy 5293 5666 373
8-Oct-12 sell 5666 5733 -67
27-Nov-12 buy 5733 5841 108
13-Dec-12 sell 5841 6006 -165
2-Jan-13 buy 6006 5958 -48
9-Jan-13 sell 5958 6036 -78
14-Jan-13 buy 6036 5981 -55
4-Feb-13 sell 5981 5610 371
11-Apr-13 buy 5610 5955 345
23-May-13 sell 5955 5904 51
1-Jul-13 buy 5904 5869 -35
26-Jul-13 sell 5869 5752 117
 

labdhi

Active Member
#9
filters i have thinked ,

tricks to be applied
1 see trend on daily , trade on 30 m in direction of trend
2 sl on trigger bar
3 5 points buffer point , means buy after trigger +5
4 adds on further confirmation
5 carry with 2 lots , exit one at fixed point , trigger bar low
 

labdhi

Active Member
#10
ford7k , thanks for reply .....
i finalize to trade with it ,
just want to add some tricks and filters and before trading want to backtest by bar to bar ,
by above data is this system is tradeable ?
i am not searching for holygrail ,
what r ur views about this system in present state and what do u think to make it better for trade ...............

and see
max consc. Loss 6 1164points and 7 1780 points

how to be prepared for above condition ?

p.s. : want to be trade on 30 m chart
 

Similar threads

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?