Hi
Could someone pleas exlane to me what these represents in a breakout strategy?
MaxAmplitude = 58
MinAmplitude = 11
OrderDistance = 4
PourcentageMin = 30
Yngve
WingParticipant
Veteran
Not without seeing the system code.
Hi Wing
Thanks for replying to my question!
Well for instant this code
DEFPARAM PreLoadBars = 0
DEFPARAM FlatAfter = 194500
LimitHour = 171500
StartHour = 091500
IF (Month = 5 AND Day = 1) OR (Month = 12 AND (Day = 24 OR Day = 25 OR Day = 26 OR Day = 30 OR Day = 31)) THEN
TradingDay = 0
ELSE
TradingDay = 1
ENDIF
if time = 084500 then
PositionSize = max(2,2+ROUND((strategyprofit-1000)/1000))
endif
MaxAmplitude = 58
MinAmplitude = 11
OrderDistance = 4
PourcentageMin = 30
ONCE StartTradingDay = -1
IF (Time <= StartHour AND StartTradingDay <> 0) OR IntradayBarIndex = 0 THEN
BuyTreshold = 0
SellTreshold = 0
BuyPosition = 0
SellPosition = 0
StartTradingDay = 0
ELSIF Time >= StartHour AND StartTradingDay = 0 AND TradingDay = 1 THEN
DayStartIndex = IntradayBarIndex
StartTradingDay = 1
ELSIF StartTradingDay = 1 AND Time <= LimitHour THEN
IF BuyTreshold = 0 OR SellTreshold = 0 THEN
HighLevel = Highest[IntradayBarIndex - DayStartIndex + 1](High)
LowLevel = Lowest [IntradayBarIndex - DayStartIndex + 1](Low)
DaySpread = HighLevel - LowLevel
MinSpread = DaySpread * PourcentageMin / 100
IF DaySpread <= MaxAmplitude THEN
IF SellTreshold = 0 AND (Close - LowLevel) >= MinSpread THEN
SellTreshold = LowLevel + OrderDistance
ENDIF
IF BuyTreshold = 0 AND (HighLevel - Close) >= MinSpread THEN
BuyTreshold = HighLevel - OrderDistance
ENDIF
ENDIF
ENDIF
IF SellTreshold > 0 AND BuyTreshold > 0 AND (BuyTreshold - SellTreshold) >= MinAmplitude THEN
IF BuyPosition = 0 THEN
IF LongOnMarket THEN
BuyPosition = 1
ELSE
BUY PositionSize CONTRACT AT BuyTreshold STOP
ENDIF
ENDIF
IF SellPosition = 0 THEN
IF ShortOnMarket THEN
SellPosition = 1
ELSE
SELLSHORT PositionSize CONTRACT AT SellTreshold STOP
ENDIF
ENDIF
ENDIF
ENDIF
IF LongOnMarket AND ((Time <= LimitHour AND SellPosition = 1) OR Time > LimitHour) THEN
SELL AT SellTreshold STOP
ELSIF ShortOnMarket AND ((Time <= LimitHour AND BuyPosition = 1) OR Time > LimitHour) THEN
EXITSHORT AT BuyTreshold STOP
ENDIF
SET STOP PLOSS MaxAmplitude
WingParticipant
Veteran
Something like this, for that strategy:
MaxAmplitude = maximum stop loss/maximum daily range to trade
MinAmplitude = minimum daily range to trade
OrderDistance = Distance from range that order is placed when breakout has occured
PourcentageMin = How large of a movement is considered an outbreak, measured in percent of today’s range so far (high-low).
Hi Wing
Thanks for the explenation, it makes sens now.
Regards
Yngve