Mr. xlitang got me inspire again with his thread Promised EA system ..
So here I continue the martingale strategy development from the old code I have (see this thread 3060EA and back test help wanted )
Timeframe: H1
Pair: GBPUSD, USDCHF
Deposit: 10,000
First Buy trade condition:
First Sell trade condition:
MFI=Money Flow Index, H1, Bar[0]
MFID=Money Flow Index, Day, Bar[0]
ema... = exp moving average
When "first" trade was placed, trailing stop loss take over the rest.
if losing, open another trade to recoup the profit by certain offset.
this offset I use 2xATR (two times of Average True Range) -- about 20-60 pips depends on the market wilderness.
The second, third, forth etc. orders have larger lot size and lower/higher than first opened trade, which is calculated by
The concept of trailing stop loss is the same as MPTM by SteveHopwood (I didn't copy but just think the same thing he did before link: http://www.stevehopwoodforex.com/php....php?f=21&t=64)
trigger1 is distance (points) to opened price/Stoploss when hit it will move the stoploss up/down (buy/sell relatively) by move1 points
Try optimizing those two number can give wide varity of outcome. I never do that. Feel free to spend your CPU time on it.
Well, I don't have forward test because I just finish it hour ago before writing this thread.
My ultimate goal (for Martingale thing) is "100$ deposit and run with Martingale strategy, standard account, 0.01 lot start and on GBPUSD Pair"..... still i'm not there yet.
DON'T USE IN REAL ACCOUNT
THIS IS PART OF MY CHALLENGING, BRAIN GRINDING AND STUPID HOBBY.
PS. Poor english, la me
So here I continue the martingale strategy development from the old code I have (see this thread 3060EA and back test help wanted )
Timeframe: H1
Pair: GBPUSD, USDCHF
Deposit: 10,000
First Buy trade condition:
Inserted Code
if(MFI<=0 && MFID>50 && CountOrder.Buy()==0 && Bid>ema50 && Bid>ema20 && Bid>Low[iLowest(NULL,0,MODE_LOW,3,0)]+100*Point )
First Sell trade condition:
Inserted Code
if(MFI>=100 && MFID<50 && CountOrder.Sell()==0 && Bid>ema50 && Bid<ema20 && Bid+100*Point<High[iHighest(NULL,0,MODE_HIGH,3,0)] )
MFI=Money Flow Index, H1, Bar[0]
MFID=Money Flow Index, Day, Bar[0]
ema... = exp moving average
When "first" trade was placed, trailing stop loss take over the rest.
if losing, open another trade to recoup the profit by certain offset.
this offset I use 2xATR (two times of Average True Range) -- about 20-60 pips depends on the market wilderness.
Inserted Code
double ATR=iATR(NULL,0,14,0);
The second, third, forth etc. orders have larger lot size and lower/higher than first opened trade, which is calculated by
Inserted Code
LotBuy=startlot*MathPow(1.4,CountOrder.Buy()); LotSell=startlot*MathPow(1.4,CountOrder.Sell());
The concept of trailing stop loss is the same as MPTM by SteveHopwood (I didn't copy but just think the same thing he did before link: http://www.stevehopwoodforex.com/php....php?f=21&t=64)
trigger1 is distance (points) to opened price/Stoploss when hit it will move the stoploss up/down (buy/sell relatively) by move1 points
Inserted Code
extern int trigger1=150; extern int move1=30;
Try optimizing those two number can give wide varity of outcome. I never do that. Feel free to spend your CPU time on it.
Well, I don't have forward test because I just finish it hour ago before writing this thread.
My ultimate goal (for Martingale thing) is "100$ deposit and run with Martingale strategy, standard account, 0.01 lot start and on GBPUSD Pair"..... still i'm not there yet.
DON'T USE IN REAL ACCOUNT
THIS IS PART OF MY CHALLENGING, BRAIN GRINDING AND STUPID HOBBY.
PS. Poor english, la me
Attached File(s)
100DollarMartingale1.0.2.mq4
10 KB
|
1,169 downloads
Func1.mqh
20 KB
|
802 downloads
Holy grail, pls pm