Hello, I found this strategy for copper made for trade station. Is it possible to conver it ?
many thanks in advance
Alex
I have not tested this, courtesy of Gemini…. Try it!
// --- Inställningar ---
DEFPARAM CumulateOrders = False
channel = 5
stochPeriod = 5
timeout = 20
riskAmount = 3500 // Belopp i din kontovaluta
// --- Indikatorer ---
// momentumx = SlowD i EasyLanguage motsvarar ofta StochasticD i PRT
momentumx = StochasticD[stochPeriod, 3, 3](close)
midpointx = (Average[channel](high) + Average[channel](low)) / 2
// --- Filter ---
// Filter #615
f615 = (ADX[14] > 25 AND RSI[14](close) < 50 AND AverageTrueRange[14](close) > AverageTrueRange[14](close)[1])
// Filter #858
f858 = (close < close[2] AND close[2] < close[1])
// --- Long Entry ---
IF NOT f615 THEN
IF close < midpointx AND momentumx > momentumx[1] THEN
BUY 1 CONTRACT AT MARKET
ENDIF
ENDIF
// --- Short Entry ---
IF NOT f858 THEN
IF close > midpointx AND momentumx < momentumx[1] THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
ENDIF
// --- Exits & Risk Management ---
// 1. Fixed Stop Loss & Profit Target
SET STOP $LOSS riskAmount
SET TARGET $PROFIT (2 * riskAmount)
// 2. Time-based Exit
IF LongOnMarket AND (BarIndex - TradeIndex >= timeout) THEN
SELL AT MARKET
ENDIF
IF ShortOnMarket AND (BarIndex - TradeIndex >= timeout) THEN
EXITSHORT AT MARKET
ENDIF
// 3. Trailing Stop vid vinst (1x risk)
// Beräknar flytande vinst i pengar
IF LongOnMarket AND (PositionPerformance * PositionPrice * CountOfPosition >= riskAmount) THEN
SELL AT lowest[4](low) STOP
ENDIF
IF ShortOnMarket AND (ABS(PositionPerformance) * PositionPrice * CountOfPosition >= riskAmount) THEN
EXITSHORT AT highest[4](high) STOP
ENDIF
PositionPerformance shall be changed into PositionPerf, I think.
Hi, thanks for the conversion. Unfortunately there must be more mistakes in conversion because performance are totally different from what I see in the future of Copper 1440 minutes for trade station.
Alessio