Trend trading EA

Locked
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Trend trading EA

Post by SteveHopwood »

PLEASE READ THE FINAL POST IN THIS THREAD


SERIOUS WARNING
  • Most Forex traders lose all their money.
    Using the robot posted here in trading Forex does not guarantee success.
    Trading this robot could lead to serious financial loss.
    Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
    This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
    At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
    To trade this robot, you have to understand:
    • - How to use EA's.
I am not trading this EA on my live account

Introduction
Find the genesis of this EA at http://www.stevehopwoodforex.com/phpBB3 ... 992#p22992

You need the attached version of SuperTrend in your indi folder. You do not need it on your charts, although it will be difficult for you to work out if the ea is working properly without it.

Working with monthly and weekly pivots means we often want to change chart time frames so that we can view all the pivots - the ea draws them for you. The time frames used by the ea are independent of the chart tf. One input is especially important - the SuperTrend section input StTimeFrame. StTimeFrame is effectively the trading time frame, so by default the ea looks for a cross of the line every 15 minutes. No idea whether this is appropriate or not.

The easiest way to describe the inputs is to reproduce the list of requirements that iarudi sent me in a pm:
  • - The EA should buy when the candle closes above the indicator and the EA Should sell when the candle closes below the indicator The default inputs in both the attached indi and the ea are those stated by iarudi in a pm

    - The EA should have the option of just buy mode – in buy mode the EA will buy when the candle closes above the indicator and close the position when the candle closes below the indicator – so when in buy mode the EA will not sell. TradeLong
    - The EA should have the option of just sell mode – in sell mode the EA will sell when the candle closes below the indicator and close the position when the candle closes above the indicator. So when in sell mode the EA will not buy TradeShort
    - When buy or sell mode is not specified the EA will be taking both buy and sell positions as per the indicator

    - The EA should have the option of adjusting the number of periods and multiplier variables of the supertrend indicator (set the default at 10 for number of periods and 1.5 for multiplier) See the SuperTrend indi inputs section of the inputs window

    - The EA should have option of adding a filter like Simple Moving Average or Exponential Moving Average or particular pivot MaTF (Moving Average Time Frame) sets the time frame for the MA. Turn this filter off with a zero value.

    - The EA should have options of alignment of pivots or no alignment of pivots (daily pivot > weekly pivot> monthly pivot and vice versa) EnforceDoubleAlignment: WP > MP for a buy. Vice-versa for a sell. EnforceTripleAlignment: DP > WP > MP for a buy. Vice-versa for a sell.

    - The EA should have the option of trading between particular hours of the day
    (to be able to trade just London or NY session) Trading hours inputs

    - Once the trade is entered EA should show it on the screen

    - The EA should have option of adjusting TP and SL for each trade TakeProfitPips and StopLossPips
    - The EA should have option of adjusting SL and TP based on ATR (Average True Range of specified number of periods) AtrPeriod setting of zero turns off this feature.
    - Other trade exit features not in the original spec are:
    • - Fractals. FractalsTimeFrame setting of zero turns this feature off.
      - Stop losses at the pivot lines =- PivotCrossPips
    - EA should have option of start trading when the market reaches a specified price. Have not done this yet - forgot.

    - The EA should also have option of taking a buy trade when price closes above pivot (not price crossing the pivot but the candle closing above the pivot BuyAboveDailyPivot plus equivalents for WP and MP
    The EA should have option of taking sell trade when the price closed below pivot SellBelowDailyPivot plus equivalents for WP and MP

    - Money management options should be available on the EA
    When the money management option is “ON” mode the EA should risk specified percentage of the available equity. RiskPercent overrides any value in Lot. RiskPercent = 1 is risking 1% of the available equity

    - The usual suspects are also available - cut-down mptm management, swap and balance features. I have forgotten the margin checks because I inadvertently left them out of the shell; I will add these in the next update.
conclusion
Please address all questions about the trading methodology to iarudi. I have no idea how (s)he intends to use it.

I have not tested the ea, so there are probably a few bugs. If the bot fails to take a trade that it should have taken, please post a picture along with a description of the trade it has missed. I can do nothing with "It dun't wurk" posts.

Have fun. We already know how powerful monthly, weekly and daily pivots are. I know a lot of people like SuperTrend. Maybe together they can be an extra-strong winner; we shall see.

:D

Matters of general interest

Read this post:
http://www.forexfactory.com/showthread. ... ost4923611 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration. There is a thread devoted to Sam's trading method at http://www.forexfactory.com/showthre...25#post5118825

Masterly summary of hedging: http://www.forexfactory.com/showthread. ... ost4977179

EA coding
I receive may requests to code EA's. Traders, if I code your EA for free, then I will share it here. If you want me to code your EA without sharing, then my fee is $100 payable into my paypal account. I explain why at http://www.forexfactory.com/showthread. ... ost4431794, at the bottom of the post.

Useful utilities/EA's/scripts
MaryJane has posted a fabulous utility to allow us to resize EA input windows: http://www.forexfactory.com/showthread.php?t=299017
Multi purpose trade manager: http://www.forexfactory.com/showthread.php?t=89371
Account equity analyser: http://www.forexfactory.com/showthre...16#post4693716 Also at http://www.forexfactory.com/showthread. ... ost4709098, which includes a template for both USD and the Euro.
Past-trades display indi by squalou; shows a graphical display of the success/failure of trades in your History tab. Breathtaking piece of work. http://www.forexfactory.com/showthread. ... ost3830610
My shell EA – the code I use to produce EA's so quickly. http://www.stevehopwoodforex.com/phpBB3 ... p?f=5&t=15
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Trend trading EA

Post by SteveHopwood »

Version 1a is in post 1.

When developing code, I have a snippet in the trade-decision function that stops actually sending a trade, so I can continue to develop the code in peace.

Here it is:

////////////////////////////////////////////////////////////////////////////////////////
//DELETE THIS OR THE EA WILL NEVER TRADE
SendLong = false; SendShort = false;
////////////////////////////////////////////////////////////////////////////////////////

I forgot to delete it. Oops.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: Trend trading EA

Post by cuzgeorge »

Hey Steve, all,
i compiled with Steve's correction posted above and have had no trades yet. Changed the one TF on EURUSD to 5M to try and get a trade, but still no luck.
Am i just impatient? :?
regards
cuzgeorge
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Trend trading EA

Post by SteveHopwood »

cuzgeorge wrote:Hey Steve, all,
i compiled with Steve's correction posted above and have had no trades yet. Changed the one TF on EURUSD to 5M to try and get a trade, but still no luck.
Am i just impatient? :?
regards
cuzgeorge
Don't know George. Don't know how this bot is supposed to trade. The OP has sent me links to some videos to explain, but I have not watched them. Once I have, I shall be able to set up the defaults for ootb use.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: Trend trading EA

Post by cuzgeorge »

No Problem Steve,
i will tinker with it and see what i can come up with.
regards and thanks for the reply.
cuzgeorge
10.X, BMac,Xmeter,Marylin,and CaptsNakedTrading thread coupled with Slowkeys Intraday setup for manual trades.
http://www.stevehopwoodforex.com/phpBB3 ... f=36&t=848
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Trend trading EA

Post by SteveHopwood »

George, put that on hold for a while.

I have watched the videos and Arjun makes brilliant sense. He wants to start at the beginning and build up the ea step by step, and I am happy to accommodate this.

I am temporarily closing this thread guys, and have deleted the EA. I will reopen it as soon as Arjun and I have completed the project. I reckon this should be worth waiting for.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Locked

Return to “Automated trading systems”