Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 08-12-2009, 06:35 PM   #1

sunilrohira's Avatar

Join Date: Sep 2008
Location: San Ramon
Posts: 84
Ignore this user

Thanks: 137
Thanked 19 Times in 12 Posts



Snake Force

I have found an indicator Snake force for MT4. Will the people experienced in coding consider coding it for Tradestation. Thanks.

Here is the cross reference.

http://www.traderslaboratory.com/for...html#post72909

Here is the source:
http://www.forex-tsd.com/suggestions...ndicators.html
Attached Files
File Type: tpl Mr[1]. Snake and The Wave.tpl (6.9 KB, 45 views)
File Type: mq4 SnakeForce.mq4 (6.0 KB, 47 views)
sunilrohira is offline  
Reply With Quote
Old 08-13-2009, 09:23 AM   #2

Blu-Ray's Avatar

Join Date: Nov 2006
Location: England
Posts: 508
Ignore this user

Thanks: 164
Thanked 288 Times in 105 Posts



Re: Snake Force

I don't think you will get anybody to respond when you only post a link to .....

a) another site which they would then have to register for just to see what it looks like.

b) the indicators and template for MT4, which if someone is willing to convert over, they would have to have MT4 installed just to see the code.

Your best bet would be to post some screenshots of the indicator and also copy the code into a text file, so if someone fancies having a go, then at least they don't have to spend ages doing the homework which should have already been done for them.

Cheers

Blu-Ray
__________________

“ Search is the ultimate expression of the power of the individual, using a computer, looking at the world, and finding exactly what they want ” – Eric Schmidt, Google
Blu-Ray is offline  
Reply With Quote
The Following 2 Users Say Thank You to Blu-Ray For This Useful Post:
sunilrohira (08-13-2009), Tams (08-13-2009)
Old 08-13-2009, 10:09 AM   #3

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,588
Ignore this user

Thanks: 2,026
Thanked 1,402 Times in 862 Posts



Re: Snake Force

I can help people to go from step 1 to step 2,

but I would not "assist" anyone to jump from step zero to step 3.

I will give a pass to anything short of a fully illustrated description.


good luck

;-)
Tams is online now  
Reply With Quote
The Following 3 Users Say Thank You to Tams For This Useful Post:
Blu-Ray (08-13-2009), HAL9000 (08-13-2009), sunilrohira (08-13-2009)
Old 08-13-2009, 06:20 PM   #4

sunilrohira's Avatar

Join Date: Sep 2008
Location: San Ramon
Posts: 84
Ignore this user

Thanks: 137
Thanked 19 Times in 12 Posts



Re: Snake Force

I am attaching some screenshots and will try to post the code later. Thanks to Blu Ray and Tams. I really appreciate it.
Attached Thumbnails
Snake Force-eurjpyh1.gif   Snake Force-eurusdh4.gif   Snake Force-gbpjpyh4.gif  
sunilrohira is offline  
Reply With Quote
Old 08-13-2009, 06:30 PM   #5

sunilrohira's Avatar

Join Date: Sep 2008
Location: San Ramon
Posts: 84
Ignore this user

Thanks: 137
Thanked 19 Times in 12 Posts



Re: Snake Force

//+------------------------------------------------------------------+
//| SnakeInBorders.mq4 |
//| "ÈÍÄÈÊÀÒÎÐÛ ÄËß ÑÀÌÎÎÁÌÀÍÀ" |
//| Bookkeeper, 2006, yuzefovich@gmail.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link ""
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Lime
#property indicator_color4 Red
//----
extern int cPeriod=24;
//----
double ForceUp[];
double ForceDown[];
double ResistanceUp[];
double ResistanceDown[];
double Mart[];
//----
double Snake_Sum, Snake_Weight, Snake_Sum_Minus, Snake_Sum_Plus;
//----
int init()
{
int draw_begin;
double indperiod,val1,val2;
string CommentStr;
draw_begin=3*cPeriod;
IndicatorBuffers(5);
SetIndexBuffer(0,ForceUp) ;
SetIndexBuffer(1,ForceDow n);
SetIndexBuffer(2,Resistan ceUp);
SetIndexBuffer(3,Resistan ceDown);
SetIndexBuffer(4,Mart);
SetIndexStyle(0,DRAW_HIST OGRAM,EMPTY,2);
SetIndexStyle(1,DRAW_HIST OGRAM,EMPTY,2);
SetIndexStyle(2,DRAW_HIST OGRAM);
SetIndexStyle(3,DRAW_HIST OGRAM);
SetIndexStyle(4,DRAW_NONE );
SetIndexLabel(2,NULL);
SetIndexLabel(3,NULL);
SetIndexLabel(4,NULL);
SetIndexDrawBegin(0,draw_ begin);
SetIndexDrawBegin(1,draw_ begin);
SetIndexDrawBegin(2,draw_ begin);
SetIndexDrawBegin(3,draw_ begin);
SetIndexDrawBegin(4,draw_ begin);
indperiod=1.0*cPeriod*Per iod();
if(indperiod<60)
{
CommentStr=DoubleToStr(in dperiod,0);
CommentStr=" M"+CommentStr+", FORCE UP -DOWN ";
}
else
{
indperiod=indperiod/60;
if(indperiod>=24)
{
val1=MathAbs(MathRound(in dperiod/24)-indperiod/24);
if(val1<0.01)
{
CommentStr=DoubleToStr(in dperiod/24,0);
CommentStr=" D"+CommentStr+", FORCE UP -DOWN ";
}
else
{
CommentStr=DoubleToStr(in dperiod/24,1);
CommentStr=" D"+CommentStr+", FORCE UP -DOWN ";
}
}
else
{
val1=MathAbs(MathRound(in dperiod)-indperiod);
if(val1<0.01)
{
CommentStr=DoubleToStr(in dperiod,0);
CommentStr=" H"+CommentStr+", FORCE UP -DOWN ";
}
else
{
CommentStr=DoubleToStr(in dperiod,1);
CommentStr=" H"+CommentStr+", FORCE UP -DOWN ";
}
}
}
IndicatorShortName("Snake InBorders"+CommentStr);
return(0);
}
//----
void deinit()
{
}
//----
int start()
{
int FirstPos, ExtCountedBars=0,i;
if(Bars<=50) return(0);
if(cPeriod<21) return(0);
ExtCountedBars=IndicatorC ounted();
if (ExtCountedBars<0) return(-1);
if (ExtCountedBars>0) ExtCountedBars--;
FirstPos=Bars-ExtCountedBars-1;
if(FirstPos>Bars-cPeriod-7)
{
FirstPos=Bars-cPeriod-7;
Mart[FirstPos+cPeriod]=SnakeFirstCalc(FirstPos+ cPeriod);
for(i=FirstPos+cPeriod-1;i>FirstPos;i--) SnakeNextCalc(i);
}
Snake(FirstPos);
return(0);
}
//----
void Snake(int Pos)
{
int i;
if(Pos<6) Pos=6;
Mart[Pos]=SnakeFirstCalc(Pos);
Drawing(Pos);
Pos--;
while(Pos>=5)
{
Mart[Pos]=SnakeNextCalc(Pos);
Drawing(Pos);
Pos--;
}
while(Pos>0)
{
Mart[Pos]=SnakeFirstCalc(Pos);
Drawing(Pos);
Pos--;
}
if(Pos==0)
{
// Mart[Pos]=iMA(NULL,0,6,0,MODE_LWMA ,PRICE_TYPICAL,0);
Mart[Pos]=iMA(NULL,0,6,0,MODE_LWMA ,PRICE_CLOSE,0);
Drawing(Pos);
}
return;
}
//----
double SnakePrice(int Shift)
{
// return((2*Close[Shift]+High[Shift]+Low[Shift])/4);
return(Close[Shift]);
}
//----
double SnakeFirstCalc(int Shift)
{
int i, j, w;
Snake_Sum=0.0;
if(Shift<5)
{
Snake_Weight=0.0;
i=0;
w=Shift+5;
while(w>=Shift)
{
i++;
Snake_Sum=Snake_Sum+i*Sna kePrice(w);
Snake_Weight=Snake_Weight +i;
w--;
}
while(w>=0)
{
i--;
Snake_Sum=Snake_Sum+i*Sna kePrice(w);
Snake_Weight=Snake_Weight +i;
w--;
}
}
else
{
Snake_Sum_Minus=0.0;
Snake_Sum_Plus=0.0;
for(j=Shift-5,i=Shift+5,w=1; w<=5; j++,i--,w++)
{
Snake_Sum=Snake_Sum+w*(Sn akePrice(i)+SnakePrice(j) );
Snake_Sum_Minus=Snake_Sum _Minus+SnakePrice(i);
Snake_Sum_Plus=Snake_Sum_ Plus+SnakePrice(j);
}
Snake_Sum=Snake_Sum+6*Sna kePrice(Shift);
Snake_Sum_Minus=Snake_Sum _Minus+SnakePrice(Shift);
Snake_Weight=36;
}
return(Snake_Sum/Snake_Weight);
}
//----
double SnakeNextCalc(int Shift)
{
Snake_Sum_Plus=Snake_Sum_ Plus+SnakePrice(Shift-5);
Snake_Sum=Snake_Sum-Snake_Sum_Minus+Snake_Sum _Plus;
Snake_Sum_Minus=Snake_Sum _Minus-SnakePrice(Shift+6)+Snake Price(Shift);
Snake_Sum_Plus=Snake_Sum_ Plus-SnakePrice(Shift);
return(Snake_Sum/Snake_Weight);
}
//----
void Drawing(int Shift)
{
double val,Dval,val1,val2,val11, val22,val3;
val= 5*(Mart[Shift]-Mart[ArrayMinimum(Mart,cPeriod ,Shift)])/9;
Dval=5*(Mart[Shift]-
Mart[Shift+1]+
Mart[ArrayMinimum(Mart,cPeriod ,Shift+1)]-
Mart[ArrayMinimum(Mart,cPeriod ,Shift)] )/9;
if(Dval>0)
{
ForceUp[Shift]=val;
ResistanceUp[Shift]=0;
}
else
{
ForceUp[Shift]=0;
ResistanceUp[Shift]=val;
}
val= 5*(Mart[Shift]-Mart[ArrayMaximum(Mart,cPeriod ,Shift)])/9;
Dval=5*(Mart[Shift]-
Mart[Shift+1]+
Mart[ArrayMaximum(Mart,cPeriod ,Shift+1)]-
Mart[ArrayMaximum(Mart,cPeriod ,Shift)] )/9;
if(Dval<0)
{
ForceDown[Shift]=val;
ResistanceDown[Shift]=0;
}
else
{
ForceDown[Shift]=0;
ResistanceDown[Shift]=val;
}
return;
}
sunilrohira is offline  
Reply With Quote
Old 08-13-2009, 07:07 PM   #6

Join Date: Feb 2007
Location: US
Posts: 314
Ignore this user

Thanks: 86
Thanked 204 Times in 89 Posts



Re: Snake Force

Quote:
Originally Posted by sunilrohira »
I am attaching some screenshots and will try to post the code later. Thanks to Blu Ray and Tams. I really appreciate it.
You should put your code in the code box so it doesn't run on (use the green spinning gear icon in the message reply box).

This indicator repaints and is also known as the 'self deception' indicator:

Quote:
04-29-2009, 01:54 PM #5 (permalink)
ronm
Junior Member

Join Date: Apr 2009
Posts: 1 Snake & Snake Force: An Exercise In Self-Deception
On the internet, I found a blog written in Russian about Snake and Snake Force. Of course I couldn't read it, but it was entitled something like "Self-Deception Indicators". After studying both, I can't think of a better sound-byte description for the both... so don't get mesmerized by the Snake.

Both of these indicators "repaint", what this means is that both can "change their mind" on signals after you have taken action based on the signal. This "repainting" it the reason the signals look soooo good on historic actions.

If you really like Snake, I suggest you use a "Linear Weighted Moving Average" in "Typical Mode" instead because this is what Snake is based on.

Snake was a total waste of time. Don't go there.

Ron M
thrunner is offline  
Reply With Quote
The Following 3 Users Say Thank You to thrunner For This Useful Post:
Blu-Ray (08-14-2009), HAL9000 (08-13-2009), Tams (08-13-2009)
Old 08-14-2009, 03:26 AM   #7

sunilrohira's Avatar

Join Date: Sep 2008
Location: San Ramon
Posts: 84
Ignore this user

Thanks: 137
Thanked 19 Times in 12 Posts



Re: Snake Force

I am aware that it repaints, but I am perfectly okay with that and I am also aware that this one does not repaint ecept the current bar, which most indicators do anyway. I am looking to use it in Tradestation, since I only have the MT4 version I posted here.
sunilrohira is offline  
Reply With Quote
Old 08-17-2009, 03:40 PM   #8

Join Date: Jan 2009
Location: st charles IL
Posts: 3
Ignore this user

Thanks: 0
Thanked 3 Times in 3 Posts



Re: Snake Force

Quote:
Originally Posted by sunilrohira »
I am aware that it repaints, but I am perfectly okay with that and I am also aware that this one does not repaint ecept the current bar, which most indicators do anyway. I am looking to use it in Tradestation, since I only have the MT4 version I posted here.
I too, enjoy using snake force, your not alone, and for good reason!!!
Attached Thumbnails
Snake Force-30-min-euro.gif  
ziggy123 is offline  
Reply With Quote
The Following User Says Thank You to ziggy123 For This Useful Post:
sunilrohira (08-19-2009)

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Snake force sunilrohira Trading Indicators 0 08-10-2009 04:58 AM
"Force Index Indicator" for Tradestation Soultrader Trading Indicators 11 06-01-2008 10:22 PM

All times are GMT -4. The time now is 01:51 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.