Very simple EA for programming

Place your new trading idea here to see if someone can automate it.
User avatar
wictorius
Posts: 8
Joined: Fri Mar 30, 2012 10:31 pm

Very simple EA for programming

Post by wictorius »

Hello,

I would like to share this strategy and I would like to ask you. Could you or anybody else program this EA, please?
_________________________________________________________________________

Only first position will be opened according to M5 timeframe in direction of last candle (basicaly doesn´t matter which way is first position opened).

Two conditions:
1 - In case of closing with profit - other position opens in the same direction and same size
2 - If the position is closed by SL - opens x-times bigger (martingale multiply coefficient) position in oposite direction untill it is closed with profit.

Necessary variabilities for further settings:
- trading time with exact minutes according to Broker
- amount of TP
- amount of SL
- amount of first position
- max. amount of consecutive SL (after reaching the max. reset to the first position amount)
- magic number
- money management
- martingale multiply coefficient after SL

See attached picture for visual explanation of strategy.

_________________________________________________________________________

If anybody tryed or programmed this EA already, please show me your results.

Thank you.

Viktor ;)
You do not have the required permissions to view the files attached to this post.
Last edited by wictorius on Thu Apr 19, 2012 2:54 pm, edited 3 times in total.
acostafulano
Trader
Posts: 243
Joined: Tue Dec 06, 2011 3:40 pm

Re: Very simple EA for programming

Post by acostafulano »

I've seen this before. I think something quite similar was coded by Steve back at FF. If I remember correctly, will take you to margin call sooner or later
User avatar
wictorius
Posts: 8
Joined: Fri Mar 30, 2012 10:31 pm

Re: Very simple EA for programming

Post by wictorius »

acostafulano wrote:I've seen this before. I think something quite similar was coded by Steve back at FF. If I remember correctly, will take you to margin call sooner or later
I don´t think so. For takeing control is there max. amount of consecutive SL (after reaching the max. reset to the first position amount). With 10.000 USD deposit I will use 0,1 LOT for first position. In main trading time it will open 30-50 trades on one pair by my visual backtest.

For this reason I looking for some programmer.
User avatar
Alpenkorps
Trader
Posts: 213
Joined: Thu Dec 15, 2011 4:03 am

Re: Very simple EA for programming

Post by Alpenkorps »

Warning for Thread opener:
Open this kind of thread in 'New Trading Ideas for Possible Automation' section.
Thread moved.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
garyfritz

Re: Very simple EA for programming

Post by garyfritz »

You would be amazed how long the market can go sideways. Each time it reverses your position size and your risk doubles. In your example above you hold 31x your original position size. When does it stop? If the market keeps going sideways, will you keep doubling to 32x, 64x, 128x, 256x, ...? Or do you give up and exit with a huge loss at some point?

Martingales are dangerous. They very rapidly increase in size and risk. They look great -- until they blow up and kill you. To reduce the risk you need a high-percentage trade setup, one that wins most of the time. That reduces the chances of a lot of consecutive losses. Unless I misunderstand, this trade setup is a coin flip -- it's basically a 50% chance of winning. Which says that 50% of the time you'll go to an L2 trade (level 2, doubled position size), 25% of the time you'll go to L3 (4x position size), etc. Get 7 losses in a row and you're holding a 128x position, and that happens about 1/2^7 = 1/128 = 0.78% of the time. Unless you have infinite money in your account, at some point you have to give up and exit (with a big loss) because you can't take on a 2x bigger position. Looking at the math, I suspect those occasional losses will completely eat the profits from all the small wins.

Are you saying you put a 5 pip SL / TP on each M5 candle? And buy or sell in the next M5 candle depending on whether the last candle exited in profit or not?

I wouldn't trade that way. Your broker would **LOVE** you, because he'd end up with more of your profit than you would. You'd be paying the spread on each trade, which is a BIG percentage of your 5 pip TP. I would design to stay in the position when the market moves in your favor, rather than exiting and entering again on each candle. Reduce the trading and spread costs.
User avatar
wictorius
Posts: 8
Joined: Fri Mar 30, 2012 10:31 pm

Re: Very simple EA for programming

Post by wictorius »

Alpenkorps wrote:Warning for Thread opener:
Open this kind of thread in 'New Trading Ideas for Possible Automation' section.
Thread moved.
Thank you for moving this thread. I´m new here, sorry.
User avatar
wictorius
Posts: 8
Joined: Fri Mar 30, 2012 10:31 pm

Re: Very simple EA for programming

Post by wictorius »

garyfritz wrote:You would be amazed how long the market can go sideways. Each time it reverses your position size and your risk doubles. In your example above you hold 31x your original position size. When does it stop? If the market keeps going sideways, will you keep doubling to 32x, 64x, 128x, 256x, ...? Or do you give up and exit with a huge loss at some point?

Martingales are dangerous. They very rapidly increase in size and risk. They look great -- until they blow up and kill you. To reduce the risk you need a high-percentage trade setup, one that wins most of the time. That reduces the chances of a lot of consecutive losses. Unless I misunderstand, this trade setup is a coin flip -- it's basically a 50% chance of winning. Which says that 50% of the time you'll go to an L2 trade (level 2, doubled position size), 25% of the time you'll go to L3 (4x position size), etc. Get 7 losses in a row and you're holding a 128x position, and that happens about 1/2^7 = 1/128 = 0.78% of the time. Unless you have infinite money in your account, at some point you have to give up and exit (with a big loss) because you can't take on a 2x bigger position. Looking at the math, I suspect those occasional losses will completely eat the profits from all the small wins.

Are you saying you put a 5 pip SL / TP on each M5 candle? And buy or sell in the next M5 candle depending on whether the last candle exited in profit or not?

I wouldn't trade that way. Your criminal would **LOVE** you, because he'd end up with more of your profit than you would. You'd be paying the spread on each trade, which is a BIG percentage of your 5 pip TP. I would design to stay in the position when the market moves in your favor, rather than exiting and entering again on each candle. Reduce the trading and spread costs.
Thank you for your opinion I see you are experienced trader but I want to try it with demo first. Or 100 USD. I can loose it...

If I will have another 100 USD profit with this EA I want to withdraw it and let it run. And every week withdraw 50% of profit and let it run until it blow it up...

But first I want to do backtests for this EA and I know it will take few weeks.
User avatar
wictorius
Posts: 8
Joined: Fri Mar 30, 2012 10:31 pm

Re: Very simple EA for programming

Post by wictorius »

garyfritz wrote:Are you saying you put a 5 pip SL / TP on each M5 candle? And buy or sell in the next M5 candle depending on whether the last candle exited in profit or not?
On each M5 candle - no. This system doesn´t work on technical analysis - just two conditions:

1 - In case of closing with profit - other position opens in the same direction and same size.
2 - If the position is closed by SL - opens x-times bigger (martingale multiply coefficient) position in oposite direction untill it is closed with profit.

Do you understand it??? :D
garyfritz

Re: Very simple EA for programming

Post by garyfritz »

Demo or small-account trading is a bad way to test a Martingale. (It's bad for ANY system, IMHO, but it's terrible for Martingales.) It will lure you in and then eat you.

You can't test it with a $100 account -- you won't have enough margin to survive the L3 - L4 - etc trades. So you put maybe $1000 into the account so you can survive a really bad series of losses. You can go along, pulling $100 out of your account every few weeks, happy as can be, until BAM! It hits you for a huge loss and blows up your account.

Martingales DO that. That's why they're dangerous. If they didn't do that, EVERYbody would trade Martingales all the time.

I would not bother even demo-testing this until you have a good accurate backtest.

No, I'm not sure I understand your description. Let's say you run it on M5, or M15, or H1, whatever. You specify X-pip SL and Y-pip TP. At the open of a bar you flip a coin and say "I'll start out going long." If it hits the TP, you go long again (same size) on the next bar. If it hits the SL, you go short on the next bar with 2x size.

That's it? That's all?

If it doesn't hit the TP or SL in the first bar, do you just leave the trade open until it hits the TP or SL? Or do you close it in the same bar, and open a new trade on every bar?

BTW it's very difficult to backtest this properly if the TP and SL generally land in the same bar. So let's say you run it on M15 EURUSD. Typical H-L range for M15 bars is about 5-15 pips. If you use 5-pip TP and SL, and enter at the open of the bar, and the bar goes +10 and -10 from the open, then both the TP and SL are hit by that bar. Which was hit first? I *think* if you do every-tick backtesting with good (M1 or tick) data, Empty4 might be able to test it accurately. If you don't do it right, you can fool yourself.
SWG123
Trader
Posts: 565
Joined: Wed Nov 16, 2011 3:02 pm
Location: Cape Town

Re: Very simple EA for programming

Post by SWG123 »

wictorius wrote: Thank you for your opinion I see you are experienced trader but I want to try it with demo first. Or 100 USD. I can loose it...

If I will have another 100 USD profit with this EA I want to withdraw it and let it run. And every week withdraw 50% of profit and let it run until it blow it up...

But first I want to do backtests for this EA and I know it will take few weeks.
Wictorius, it's your money so you can do whatever you want with it. I will say that garyfritz is one of the most thorough analysers (OK, analyzers for you Gary :) ) on this forum. FWIW, I agree entirely with his assessment of your proposed strategy. But good luck anyway. :D
Post Reply

Return to “Ideas for Possible Automation”