SDM Trading Strategy Definition
Any trading strategy needs the following three elements:
| Warmup (pre entry) |
Logic to describe when to go long or
short, the position entry conditions executed on each bar, In the SDM system we use the following "Warmup level":
Logic: ;------ Calculate CCI indicator (14 bars, 9 Avg) --------- $CCI = CCI(14,9) Strategy: ;------ Check if we are in our time range ---------------- ;------ 9:45:00 to 12:00:00 and 13:05:00 to 15:20:00 ----- if NoRange(Time,94500,120000,130500,152000) exit endif ;------ Make sure we are flat ---------------------------- if NoRange(WarmupStatus,-94,94) exit endif ;------ Check if CCI indicator has a value ---------------- ;------ (1st bars don't have yet a CCI Value) ------------- if $CCI <> Empty WarmupStatus = 20 if $CCI < -80 WarmupStatus = 20 if $CCI < -100 PositionEntry("Long") ; WarmupStatus automatically set to 100 PlaySound("CashRegister") endif endif endif |
||||||||||||||
| Entry (at entry once) |
Logic to describe the standard
position exit conditions called only once when a new position opened Example: ;---------- POSITION ENTRY ------------------------ Entry: PositionExit("Target",0,2.5) PositionExit("Stop",0,2) Set the target 1.5 points away from the actual position entry price (longs above, shorts below) and the stop out price at 2.0 points away from the entry price (longs below, short above) |
||||||||||||||
| Exit (while long/short) |
Logic to describe custom position
exit conditions called only on each bar close when you are long or short Example: ;---------- POSITION EXIT LOGIC ------------------------- Exit: ;------ LONG ----------------- if PositionDirection > 0 ;--- If we have more than 2 pts gain ---- ;--- set stop out to break even -0.25 --- if PositionMaxGain >= 2.25 $PrcStopG = PositionEntryPrice - 0.25 if $Stop < $PrcStopG PositionExit("Stop",$PrcStopG,0) endif endif ;--- If CCI is larger than 70 - exit immediatelly at market --- if $CCI > 70 PositionExit("ExitNow","90/200","CCI") endif endif |
SDM Position Management Functions
| $Stop = GetPositionExit([nExitType]) | Get Stopout level of specified ExitType (default = closest
to Entry)
|
||||||||||||||||||||||||||||||
| PositionAgeSec | Age of current position (Seconds from entry) | ||||||||||||||||||||||||||||||
| PositionAgeDays | Age of current position (Days from entry) | ||||||||||||||||||||||||||||||
| PositionDirection | Indicates the current Position status:
|
||||||||||||||||||||||||||||||
| PositionEntry("Dir"[,Entry[,Wait[,Tar[,Stop]]]) | Position Entry (If CheckPoints enabled
new CheckPoint):
|
||||||||||||||||||||||||||||||
| PositionExit("Type",par1[,par2...]]) | Define a position exit condition in the "Entry"
logic section or module:
|
||||||||||||||||||||||||||||||
| PositionMaxGain | Maximum Gain in Points from Entry | ||||||||||||||||||||||||||||||
| PositionMaxLoss | Maximum Loss in Points from Entry (always positive value or 0) | ||||||||||||||||||||||||||||||
| PositionPoints | Current Gain/Loss in points from Entry Price | ||||||||||||||||||||||||||||||
| PositionStatus = CheckPositionExit() | Check if any of the defined standard
position exits triggered Evaluates all defined position exits and returns a normalized value |
||||||||||||||||||||||||||||||
| PositionStop | Current Stop out price | ||||||||||||||||||||||||||||||
| PositionTarget | Current Position Target Price | ||||||||||||||||||||||||||||||
| WarmupStatus | Current level of your Warmup | ||||||||||||||||||||||||||||||
| CheckPoint("Dir"[,Entry[,Back]]) | Instead of a position entry - create a check point during back testing. Checkpoints allow you to execute instant statistical analysis, applying custom filter conditions and checking the average Position Gain/Loss over time since the entry (normalized to point distance from various entry prices) (Make sure Checkpoints are enabled in Setup!) (You can also create checkpoints with PositionEnrty())
|
||||||||||||||||||||||||||||||
© Copyright 1998-2003, Burkhard Eichberger,
Professional Software Solutions
All Rights Reserved Worldwide.