Experiments in Technical Analysis

Hi Pk

Excellent. Nice to see that you are experimenting and learning.. :clapping:

To be frank I am not a real fan of back Testing. I always get confused when I do a back test. When I run the back test on nifty stocks i would get acceptable results. When I run it on Midcaps the results would be pathetic. Even on testing in nifty particular stocks would come out big winners. I have played around with different setting and come out more confused. Hence I am not the correct person to advise on equity curve smoothing.

In my opinion over optimization generally produces a very smooth equity curve. This sort of curve fitted equity curve would look nice but necessarily produce results in real time. Other methods I have come across for smoothing the equity curve are adjusting the position sizing and increased trade frequency. You can play with position sizing and see.

Another important thing to see in the results of back testing is the distribution of profit. I mean a large number of stocks making decent profits is much better than a few stocks making huge profits while the remaining lot ends up loss. I trading system which is more consistent on large of stocks is any day better.

Using a walk forward optimization is always better. I think this is available in the latest version of AB.

Please do post the results / test of the system posted by me and also your question. We can learn a lot from that.

warm regards

Karthik
Another of those based on Range.

The original concept of SR based system was inspired by Saint's work but the code is based on the system posted by Karthik.



Range based SRs​



Saint Flow
(no adds, no gaps, no wrbs or BO failures, no lots of other things)​


The example above is one of the ideal cases, we do get lots of wips.

You can see from both the charts that use of the buffer / filter or room make a big difference in getting right reversals and avoiding wipsaws.

Also the moneny management lesson of the flow method have been an eye opener for me, the adds will make all the difference, I have incorporated the filter concept buy yet to fully get the adds in.

I have posted a question to Karthik earlier on this thread, if you do find some time plz get back on that.

How to optimize a system/method to get a smoother equity curve? If you want I will upload examples / test runs based on the system you have shared on your blog (also posted here at later date). If that helps I can also ask you specific questions based on those backtests.

Regards
PK
All greetings from Russia! I read your forum, it is very useful conclusions made for sebya.Osobenno interested in your sistema.K Sorry I'm not good at writing podobnogo.Byl would be very glad if you shared formuloy.Zaranee thanks.:thumb:
 
Another of those based on Range.

The original concept of SR based system was inspired by Saint's work but the code is based on the system posted by Karthik.



Range based SRs​



Saint Flow
(no adds, no gaps, no wrbs or BO failures, no lots of other things)​


The example above is one of the ideal cases, we do get lots of wips.

You can see from both the charts that use of the buffer / filter or room make a big difference in getting right reversals and avoiding wipsaws.

Also the moneny management lesson of the flow method have been an eye opener for me, the adds will make all the difference, I have incorporated the filter concept buy yet to fully get the adds in.

I have posted a question to Karthik earlier on this thread, if you do find some time plz get back on that.

How to optimize a system/method to get a smoother equity curve? If you want I will upload examples / test runs based on the system you have shared on your blog (also posted here at later date). If that helps I can also ask you specific questions based on those backtests.

Regards
PK
All greetings from Russia! I read your forum, it is very useful conclusions made for sebya.Osobenno interested in your sistema.K Sorry I'm not good at writing podobnogo.Byl would be very glad if you shared formuloy.Zaranee thanks.
 
Thank You dear karthikmarar For This Useful idea this would be highly use full to the traders and once it works this would increase the confidence level to the lossers who are dipressed by this market condition
 
Dear Mr. Karthik and Casoni,

Thanks again for the afl but karthik sir can u create the afl with both the systems coded in one also casoni y the tf is 2,3,6,12 and 24 min while karthik sir's explanation says 15m 30m 1hr and 5m chart to be prefered to long entry

can u both help me to understand the whole subject

hope to hear soon
 

McNish

Active Member
Hey Karthik, I'm in the middle of this thread, guess the first two pages only. I'm going through other threads also, pivots and Saint's fishing. I don't want to fast jump any thread but the fishing is 180 pages as of today. here when you describe your first initial trading system setup of moving averages, It sounds a lot like what's happening with me too. I'm a relatively new trader as were you when you developed your first system. I too have made a very similar trading system wherein I have set my software to show 5, 7, 14 and 21 day SMA's whenever I open historical charts. In a short while I'm also going to add the RSI indiactor. All this before I reached this thread. I chanced upon this while looking for strong indicators. They are with the intention of catching trend revarsal early.
I just felt like jotting all this here generally. There's a lot I have learnt in this short time of 3 months. I've done quite a bit of R&D with different software. I use two to three different softwares in conjunction with oneanother. I have developed my own system of notation for the stock market as I'm a full time trader, - I've yet to view this full time trader thread.
I do have a sureshot system in mind which if applied can give fabulous results but it would need a systematic order of number chrunching for TA and sound FA along with a few more inputs too. Though I'm still in the conceptualisation phase, I have one more person , a friend of mine in the same line of trade, whome I work with who I call my team mate as the whole setup requires simultanious manhours of two peolpe minimum. It's not that one person can't do it alone as for that it needs a good 3 to 4 manhours everyday. Best part is "I'm have fun while I'm at it."
Somewhere in one of the posts, I think it was you who mentioned "Timing the Markets". How can I get a copy of one. I live in Lucknow though. And yes, your email please. I'm sure we can exchange mail Id's here for private conversations. Let know. Will wait for your response. Manish.
 
Friends

I have uploaded the afls and Metastock codes which had to deleted because of the restriction on the space for attachments. I have also included a PDF document containing the excerpts from this thread.

The Link for the 4shared folder is
http://www. 4 s h a r e d.com/dir/7777958/973587e4/Traderji_Stuff.html

Please remove the spaces in the word 4shared..

Regards

Karthik
HI EVERY ONE
GREETINGS TO U MR.KARTHIK
AM A NEW MEMEBER WHO IS TRAING TO LEARN ABOUT TA , AM USING METASTOCK.
I HAVE NO IDAI ABOUT STTENG OR WRITING CODES BUT AM TRAYING.
CAN YOU PLEASE PROVIDE ME SOME EXPERTS CODES WITH THE SAME WAY YOU USED FOR EMA9+EMA13 IN THE LINK SHOWN IN QUOTED.

IT IS EASY FOR ME TO USE SUCH CLAER CODES .

I WILL APPRECATE IF CHEK, DEVELOPE AND GIVE COMMENTS ON THE FOLLOWING INDICATOR:

var SMASer, SMAOffset, Bar, LBar, P1, HP1, x : integer ;
var y, z, Diff : float ;

LBar := BarCount - 1 ;

// Needs to be an even number
P1 := 250 ;
HP1 := P1 / 2 ;
SMASer := SMASeries (#Close, P1) ;
SMAOffset := OffsetSeries (SMASer, + HP1) ;
y := GetSeriesValue (LBar - HP1, SMAOffset) ;
x := P1 ;
for Bar := LBar - HP1 + 1 to LBar do
begin
x := x - 1 ;
z := SMA (LBar, #Close, x) ;
SetSeriesValue (Bar, SMAOffset, z) ;
end ;
PlotSeries (SMAOffset, 0, #Blue, #Thin) ;
DrawLine (LBar - HP1, y * 0.9, LBar - HP1, y * 1.1, 0, #Blue, #Dotted) ;
DrawText ('CMA (' + IntToStr (P1) + ')', 0, 10, 40, #Blue, 8) ;

Diff := StdDev (LBar, #Close, P1) ;
PlotSeries (AddSeriesValue (SMAOffset, Diff), 0, #Blue, #Dotted) ;
PlotSeries (AddSeriesValue (SMAOffset, Diff * 2), 0, #Blue, #Dotted) ;
PlotSeries (AddSeriesValue (SMAOffset, Diff * 3), 0, #Blue, #Dotted) ;
PlotSeries (SubtractSeriesValue (SMAOffset, Diff), 0, #Blue, #Dotted) ;
PlotSeries (SubtractSeriesValue (SMAOffset, Diff * 2), 0, #Blue, #Dotted) ;
PlotSeries (SubtractSeriesValue (SMAOffset, Diff * 3), 0, #Blue, #Dotted) ;

var EXTPane, EXT2Pane : integer ;
EXTPane := CreatePane (100, false, true) ;
EXT2Pane := CreatePane (100, false, true) ;

PlotSeries (SMASer, 0, #Lime, #Thin) ;
DrawText ('SMA (' + IntToStr (P1) + ')', 0, 10, 50, #Lime, 8) ;
PlotSeries (DivideSeries (#Close, SMASer), EXTPane, #Lime, #Thick) ;
DrawText ('Price / SMA (' + IntToStr (P1) + ')', EXTPane, 5, 5, #Lime, 8) ;
DrawHorzLine (1, EXTPane, #Black, #Dotted) ;

var SMASer2 : integer ;
SMASer2 := SMASeries (#Close, 50) ;

PlotSeries (SMASer2, 0, #Red, #Thin) ;
DrawText ('SMA (50)', 0, 10, 60, #Red, 8) ;
PlotSeries (DivideSeries (#Close, SMASer2), EXT2Pane, #Red, #Thick) ;
PlotSeries (DivideSeries (#Close, SMAOffset), EXT2Pane, #Blue, #Thick) ;
DrawLabel ('Momentum', EXT2Pane) ;
DrawHorzLine (1, EXT2Pane, #Black, #Dotted) ;
procedure SMA65VolumeColor;
begin
var Bar, BCnt: integer;

// Make sure there is an average even if the symbol has less than 65 bars
if BarCount < 66 then
BCnt := BarCount
else
BCnt := 65;

// Draw SMA and label in volume pane
PlotSeries( SMASeries( #Volume, BCnt ), 1, 009, #Thick );
DrawText( 'SMA(Volume,' + IntToStr(BCnt) + ') = ' + FormatFloat( '#,###', SMA( BarCount - 1, #Volume, BCnt ) ), 1, 4, 4, #Black, 12 );

for Bar := 1 to BarCount - 1 do
if PriceClose( Bar ) > PriceClose( Bar - 1 ) then
SetSeriesBarColor( Bar, #Volume, #Green )
else
SetSeriesBarColor( Bar, #Volume, #Red );
end;

SMA65VolumeColor;
SetLogScale( 0, true )​

CAN YOU CREATE AN EXPERT USING THE ABOVE CODES.

WAITNG TO READ YOUR REPLY
 
sir

greetings,

can you try to initiate MS expert using the following conditions:

ADX +/- line cross must have occurred
SAR must be above/below market price

BUY = IF +Di Line has crossed above the -Di Line AND SAR value (price) is
BELOW market price.

SELL = IF -Di Line has crossed above the +Di Line AND SAR value (price) is
ABOVE market price.

ADX Difference: If there is a value in this feature, the order may not be placed till the +/- lines have reached this distance in relation to the most current cross. Above conditions must still be met for order to be placed, this is just a feature to filter out whipsaws.

Conditions for Trades to be Closed:

SAR value (price) switches sides, indicating a trend reversal.
------------------------------ <div id=":ss" class="ii gt"><wbr></wbr>

Filtering out False Signals:

To ensure that a trade is not initiated on a false signal, the trade initiated
must occur on the next bar (after the bar in which +/- cross occurred
in) Also, the SAR value (price) needs to be congruent to the line that
crossed over on the ADX, if there are conflicting signals between the
ADX and SAR which position to take, no position should be assumed.
This is to minimize losing trades on a trend.

To ensure that a trade is not closed on a false signal, the trade(s)
must be closed on the next bar (after the SAR value has switched sides
indicating a trend reversal) This is to maximize profits. As you can
see how having a T/P mark would limit profits as the trend continues.


It is my experience with the ADX and SAR that as the +/- lines
approach each other, they 'kiss and run away' then may do it again
multiple times in a M15 T/F before actually finally crossing. The SAR
will switch sides back and forth as the market price approaches it,
registering a trend reversal many times when it actually may not
reverse by the time the bar closes. I believe that these things can be
fixed by the solutions described above.
 

Similar threads