log in     sign up for free
 
My percentage of winners is only about 50/50, because I cut my losers very quickly. The maximum loss I allow is 7 percent, and usually I am out of a losing stock a lot quicker. I make my money on the few stocks a year that double and triple in price.
David Ryan
 
 
Home
systems (285)
 
 
Special offer: buy MetaStock (try for free)   |   Reuters QuoteCenter Real-Time Data (get a free month)   |   EOD Data
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

DBS-March

System for: TradeStation

 

 

Views:  1817

Added: December 08, 2006
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 
 

email this link

 
 
Tags: TradeStation, system
 




Code:

Typ : Signal Name : DBS-March
Inputs: Ceil(60), Flr(20),
{Additional inputs}
TStop1(0), StopB1(999), StopV1(0),
TStop2(0), StopB2(999), StopV2(0),
TAdd3(0), AddB3(999), TStop3(0), StopB3(999), Alpha3(0), Beta3(0),
TAdd4(0), AddV4(0), TStop4(0), StopV4(0), Alpha4(0), Beta4(0);

Var: X(0), Y(0), ZDelta(0), VarA(0), VarB(0), OldVarA(0), Pos(0), OpLoss(0), OpPro(0), BottDay(0), PeakDay(0),
{Additional variables}
Trigger(0), MaxReg(0);

Y = X;
X = Stddev(Close, 30);
ZDelta = (X - Y) / X;

If CurrentBar =1 then
VarA = 20;

OldVarA = VarA;
VarA = OldVarA * (1 + ZDelta);
VarA = MaxList(VarA, Flr);
VarA = MinList(VarA, Ceil);
VarB = VarA * 0.5;

Buy ("Go Long") tomorrow at Highest(High, VarA) Stop;
Sell ("Go Short") tomorrow at Lowest(Low, VarA) Stop;
ExitLong ("Exit Long") tomorrow at Lowest(Low, VarB) Stop;
ExitShort ("Exit Short") tomorrow at Highest(High, VarB) Stop;

{Additional trading}

If BigPointValue <> 0 and EntryPrice <> 0 Then Begin
Trigger = (PositionProfit/BigPointValue) * 100 / EntryPrice;
MaxReg = (MaxPositionProfit/BigPointValue) * 100 / EntryPrice;
End;

If TStop1 = 1 Then Begin
If BarsSinceEntry >= StopB1 and Trigger < StopV1 Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 1") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 1") tomorrow at Open Stop;
End;
End;

If TStop2 = 1 Then Begin
If BarsSinceEntry >= StopB2 and Trigger < StopV2 Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 2") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 2") tomorrow at Open Stop;
End;
End;

If TAdd3 = 1 Then Begin
If BarsSinceEntry >= AddB3 and
Trigger Crosses Over (Alpha3 + Beta3 * BarsSinceEntry) Then Begin
If MarketPosition = 1 Then
Buy ("Add Long 3") tomorrow at Open Stop;
If MarketPosition = -1 Then
Sell ("Add Short 3") tomorrow at Open Stop;
End;
End;

If TStop3 = 1 Then Begin
If BarsSinceEntry >= StopB3 and
Trigger Crosses Under (Alpha3 + Beta3 * BarsSinceEntry) Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 3") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 3") tomorrow at Open Stop;
End;
End;

If TAdd4 = 1 Then Begin
If MaxReg >= AddV4 and
Trigger Crosses Over (Alpha4 + Beta4 * MaxReg) Then Begin
If MarketPosition = 1 Then
Buy ("Add Long 4") tomorrow at Open Stop;
If MarketPosition = -1 Then
Sell ("Add Short 4") tomorrow at Open Stop;
End;
End;

If TStop4 = 1 Then Begin
If MaxReg >= StopV4 and
Trigger Crosses Under (Alpha4 + Beta4 * MaxReg) Then Begin
If MarketPosition = 1 Then
ExitLong ("Stop Long 4") tomorrow at Open Stop;
If MarketPosition = -1 Then
ExitShort ("Stop Short 4") tomorrow at Open Stop;
End;
End;

{End additional trading}

Pos = MarketPosition;
OpLoss = MaxPositionLoss;
OpPro = MaxPositionProfit;

If OpLoss < OpLoss[1] And Pos <> 0 Then
BottDay = BarsSinceEntry;

If OpPro > OpPro[1] And Pos <> 0 Then
PeakDay = BarsSinceEntry;

{Percentage export}

If CurrentBar = 1 Then
Print(File("c:UaSystemsExam.txt"),"EntryDate",",","EntryPrice",",",
"MarketPosition",",","MaxPositionLoss",",","BottomDay",",",
"MaxPositionProfit",",","PeakDay",",","PositionProfit",",","LengthOfTrade");

If Pos <> Pos[1] And Pos[1] <> 0 Then
Print(File("c:UaSystemsExam.txt"),EntryDate(1),",",EntryPrice(1),",",
MarketPosition(1),",",(MaxPositionLoss(1)/BigPointValue)*100/EntryPrice(1),
",",BottDay,",",(MaxPositionProfit(1)/BigPointValue)*100/EntryPrice(1),
",",PeakDay,",",(PositionProfit(1)/BigPointValue)*100/EntryPrice(1),",",
BarsSinceEntry(1));

{End percentage export}


 




 

Code to difficult? Find somebody to help you with coding here.

 


Source: http://www.futuresmag.com

 

View similar:

TrueContrarian
Conner 19
HI LO Activator
Sideways
Phil Lane\'s System
DBS-March
Finite Volume Element (FVE) System
Test IDNR4
True Range Breakout
Macd Momentum System
...
 
 
all systems for TradeStation
all systems

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009