so i thank you very much. I m happy that you help me.
So lets begin.
// OriginalTrade: Code without Martingale
// Tradingsystem TuesdayLongThursday DAX 1 Euro Mini TimeFrame 1H
// with martingale
// OriginalTrade
MA1 = Average [1]
MA2 = Average [2]
c1 = Ma1>MA2
t1 = time = 180000
t2 = time = 090000
d1 =dayofweek = 2
d2 = dayofweek = 4
If d1 And t1 and c1 THEN
buy 1 Contract At Market
Endif
If d2 and t2 then
sell at market
endif
Set Stop PLoss 60 // from Trade
Set Target PProfit 150 // from Trade
And now: please integrate the martingale. little bit more complex then my first question
Once StrategyProfit = 0
Set Stop Loss StrategyProfit = 600 points // from Strategy !
Set Target StrategyProfit = 1.500 points // from Strategy !
in this new more compexer way, new codelines needed
If the TradeProfit from first trade > 0 = then
cumulate the winnings to StrategyProfit And start OriginalTrade again
Endif
If after first trade the TradeProfit < 0 then
cumulate the Losses to StrategyProfit And Start OriginalTrade again with PostionSize(new) to reach the Target TradeProfit // to find the Positionsize(new) is one codingproblem, i told
Endif
If the TradeProfit from second trade > 0 = then
cumulate the winnings to StrategyProfit And start OriginalTrade again
Endif
If after second trade the TradeProfit < 0 then
cumulate the Losses to StrategyProfit And Start OriginalTrade again with PostionSize(new) to reach the Target TradeProfit // to find the Positionsize(new) is one codingproblem, i told
Endif
and so one and so one and so and so to : n-trade
Stops and Targets see above
IF StrategyProfit = -600 Or + 1.500 points Then
Quit Strategy
Endif // Last If Endif makes Stop PLosses and Target PProfits of the Strategy redundant but more stringent
Understand? Can help?
the OriginalTrade in PRT Backtest is positiv, testet 15.000 units (backt to 23.01.15 to yet, included up and down in dax 1 euro)
kind regards