stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

10.7 trading helpers by Steve and others
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3561
Page 4 of 9
Author:  SteveHopwood [ Mon May 05, 2014 10:27 am ]
Post subject:  10.7 trading helpers by Steve and others

kwchau » Mon May 05, 2014 7:06 am wrote:Hi Steve, I believe these EAs are designed to stop entering new trade after a trade is entered at Stoch 10. Is there a simple way to change the code such that it will also enter another trade at Stoch 30 after the first trade at Stoch 10 has entered?

Hope there is an easy way to do this ?
Nope, there is no easy way but I am about to take a bath..........................................

:xm:
Author:  SteveHopwood [ Mon May 05, 2014 12:55 pm ]
Post subject:  10.7 trading helpers by Steve and others

kwchau » Mon May 05, 2014 7:06 am wrote:Hi Steve, I believe these EAs are designed to stop entering new trade after a trade is entered at Stoch 10. Is there a simple way to change the code such that it will also enter another trade at Stoch 30 after the first trade at Stoch 10 has entered?

Hope there is an easy way to do this ?
Have a play with the attached and see if it works before I make the changes to the other ea's. I have:
  • added two new inputs - Trade1Comment & Trade2Comment. Taking a buy as an example, trade 1 is the cross of the 10, trade 2 the cross of the 30. The ea's have to know whether there is already a trade open at the relevant level, so I have used trade comments for identification.
  • added two more variables, Trade1Open and Trade2Open. CountOpenTrades() sets these to 'true' if it finds a trade with the appropriate comment.
  • added code to ReadIndicatorValues() to set the variable TradeComment to the relevant one, to save having to make a shed-load of changes elsewhere in the code.
  • changed the system specific code to: if ((StoCrossStatus == crosslong10 && !Trade1Open) || (StoCrossStatus == crosslong30 && !Trade2Open))
  • changed the conditions that allow LookForTradingOpportunities() to be called
I will create the other ea's if this one works.

:xm:
Author:  twelve [ Mon May 05, 2014 1:08 pm ]
Post subject:  10.7 trading helpers by Steve and others

Pressurized. Just eyed How 2 Do the DashBoard and that's magic - an amazing two pips.

Cheers,
Author:  kwchau [ Mon May 05, 2014 1:18 pm ]
Post subject:  10.7 trading helpers by Steve and others

SteveHopwood » Mon May 05, 2014 8:55 pm wrote: Have a play with the attached and see if it works before I make the changes to the other ea's. I have:
  • added two new inputs - Trade1Comment & Trade2Comment. Taking a buy as an example, trade 1 is the cross of the 10, trade 2 the cross of the 30. The ea's have to know whether there is already a trade open at the relevant level, so I have used trade comments for identification.
  • added two more variables, Trade1Open and Trade2Open. CountOpenTrades() sets these to 'true' if it finds a trade with the appropriate comment.
  • added code to ReadIndicatorValues() to set the variable TradeComment to the relevant one, to save having to make a shed-load of changes elsewhere in the code.
  • changed the system specific code to: if ((StoCrossStatus == crosslong10 && !Trade1Open) || (StoCrossStatus == crosslong30 && !Trade2Open))
  • changed the conditions that allow LookForTradingOpportunities() to be called
I will create the other ea's if this one works.

:xm:
Thank you Steve, will test it and let you know !
Author:  kwchau [ Mon May 05, 2014 3:01 pm ]
Post subject:  10.7 trading helpers by Steve and others

SteveHopwood » Mon May 05, 2014 8:55 pm wrote: Have a play with the attached and see if it works before I make the changes to the other ea's. I have:
  • added two new inputs - Trade1Comment & Trade2Comment. Taking a buy as an example, trade 1 is the cross of the 10, trade 2 the cross of the 30. The ea's have to know whether there is already a trade open at the relevant level, so I have used trade comments for identification.
  • added two more variables, Trade1Open and Trade2Open. CountOpenTrades() sets these to 'true' if it finds a trade with the appropriate comment.
  • added code to ReadIndicatorValues() to set the variable TradeComment to the relevant one, to save having to make a shed-load of changes elsewhere in the code.
  • changed the system specific code to: if ((StoCrossStatus == crosslong10 && !Trade1Open) || (StoCrossStatus == crosslong30 && !Trade2Open))
  • changed the conditions that allow LookForTradingOpportunities() to be called
I will create the other ea's if this one works.

:xm:
Hi Steve, I've put the EA to test on H1 charts, glad to report that the EA just triggered in three different instances Trade 1 and Trade 2 properly. It seems working as expected. In another instance, I dragged the EA to the chart when stoch is over 10 but below 30 without Trade 1, it entered Trade 2 when Stoch crossed 30, which is good.

There is also an instance that after Trade 1 was entered, because the price action was fast, Stoch 30 was crossed at the start of a new H1 bar, there was no Trade 2 entered. I believe Trade 2 was not entered due to maximum slippage of 5 pips was exceeded.
Author:  SteveHopwood [ Mon May 05, 2014 10:02 pm ]
Post subject:  10.7 trading helpers by Steve and others

kwchau » Mon May 05, 2014 3:01 pm wrote:
SteveHopwood » Mon May 05, 2014 8:55 pm wrote: Have a play with the attached and see if it works before I make the changes to the other ea's. I have:
  • added two new inputs - Trade1Comment & Trade2Comment. Taking a buy as an example, trade 1 is the cross of the 10, trade 2 the cross of the 30. The ea's have to know whether there is already a trade open at the relevant level, so I have used trade comments for identification.
  • added two more variables, Trade1Open and Trade2Open. CountOpenTrades() sets these to 'true' if it finds a trade with the appropriate comment.
  • added code to ReadIndicatorValues() to set the variable TradeComment to the relevant one, to save having to make a shed-load of changes elsewhere in the code.
  • changed the system specific code to: if ((StoCrossStatus == crosslong10 && !Trade1Open) || (StoCrossStatus == crosslong30 && !Trade2Open))
  • changed the conditions that allow LookForTradingOpportunities() to be called
I will create the other ea's if this one works.

:xm:
Hi Steve, I've put the EA to test on H1 charts, glad to report that the EA just triggered in three different instances Trade 1 and Trade 2 properly. It seems working as expected. In another instance, I dragged the EA to the chart when stoch is over 10 but below 30 without Trade 1, it entered Trade 2 when Stoch crossed 30, which is good.
Yes, and using a buy as an example because I think more easily in buy terms. As coded the ea should take Trade 2 if the price dips below, then rises above 30, it will take a Trade 2 even though there is no Trade 1. If the price plummets and the EA subsequently spots a Trade 1 opportunity, it will take it.

So, do you want me to create the additional ea's that equate to the original but allow two trades?

:xm:
Author:  kwchau [ Mon May 05, 2014 11:40 pm ]
Post subject:  10.7 trading helpers by Steve and others

SteveHopwood » Tue May 06, 2014 6:02 am wrote: Yes, and using a buy as an example because I think more easily in buy terms. As coded the ea should take Trade 2 if the price dips below, then rises above 30, it will take a Trade 2 even though there is no Trade 1. If the price plummets and the EA subsequently spots a Trade 1 opportunity, it will take it.

So, do you want me to create the additional ea's that equate to the original but allow two trades?

:xm:

Yes please, they are useful in a volatile market condition ! Your help is highly appreciated.
Author:  SteveHopwood [ Tue May 06, 2014 10:32 am ]
Post subject:  10.7 trading helpers by Steve and others

I have put all four trade twice helpers into post 1. Old stagers know to be highly alarmed when they read this next statement: it involved a lot of copy/paste/edit. :oops: Good luck guys. Only an idiot uses them on a live account in his most vivid nightmares without demo-testing them first. Report copy/paste/edit bloops here.

I noticed that whilst the helpers were checking Stoch7 for trade closure opportunities at every tick, they were looking at the value at the close of the previous candle. This seems a tad pointless, so I have changed the code in all the helpers so that they look at the Stoch7 value at each tick and uploaded the new versions to post 1. Those of you who want to make the changes to your own files to preserve your hard-coded inputs:
  • go to bool LookForTradeClosure(int ticket)
  • scroll down to if (UseStoch7ForExit==true)
  • change the dStochMain[1] to dStochMain[0]
:xm:
Author:  twelve [ Tue May 06, 2014 3:41 pm ]
Post subject:  10.7 trading helpers by Steve and others

Report to front of house for pick-up by men in white coats. Not necessary, just kidding. The American band will come into your house....

I've read Tom Demarks how to trade the Trend Line, and that appears to address your code query: Drawing objective trendlines, Currency Trader September 2006.

The section of reference defines Upside breakout qualifiers and Downside breakout qualifiers.

Cheers,
Author:  SteveHopwood [ Tue May 06, 2014 6:42 pm ]
Post subject:  10.7 trading helpers by Steve and others

Looks like there are bloops in the trade twice helpers - my buy twice sent two Trade 1 trades. I will look into this.

:xm:
All times are UTC Page 4 of 9