TMA_CG: EA to buy at support & sell at resistance

Post Reply
User avatar
SpiderX
Trader
Posts: 554
Joined: Thu Aug 22, 2013 4:50 pm

Re: TMA_CG: EA to buy at support & sell at resistance

Post by SpiderX »

pete14 » Sat Jan 25, 2014 8:47 pm wrote:
Can you post the indi?
Hi,

Attached is TMACGKumo_NoRepaint.
The way to run this is either to put it on a chart and wait....
Or to run strategy tester with a random strategy and Model set as Control Points...then throw the indicator on the chart which the "backtest" is running.
You can set model as every tick but it would be a lot slower.
Visual mode has to be enabled and you can set the backtest speed to slow first , throw in the indie, then increase the speed.
That was the method i used to generate the picture above.

Cheers

EDIT
27/1/2012: Updated to remove initialize error. Sorry reuploaded again
You do not have the required permissions to view the files attached to this post.
Last edited by SpiderX on Mon Jan 27, 2014 4:12 pm, edited 3 times in total.
"Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs.Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres."
-Corinthians 13:4-8
pete14
Trader
Posts: 73
Joined: Thu Feb 02, 2012 1:29 pm
Location: Germany

Re: TMA_CG: EA to buy at support & sell at resistance

Post by pete14 »

thanks for the indi. I'll play a little bit and will see what happens.

Cheers
User avatar
forextra
Trader
Posts: 42
Joined: Tue Mar 12, 2013 12:34 pm
Location: Perth, Australia

Re: TMA_CG: EA to buy at support & sell at resistance

Post by forextra »

Hi – hope someone can help me with a few lines of code.
I’ve been trying adapt one of Dudest’s EA’s but I’m feeling more like a butcher than a coder.
What I’m trying to achieve is THIS:
When the previous 15m candle closes above the UpperBand and price (Ask) crosses back below the UpperBand iniate a SELL trade. TP when BID hits the MiddleBand.
And for a Buy when the previous 15m candle closes below the LowerBand and price (Ask) crosses back above the LowerBand iniate a BUY trade. TP when Ask hits the MiddleBand
So in layman’s terms I want to somehow amend (or re-write) the following code to reflect the highlighted parts.
// Short - start
bool short_condition1 = (PREVIOUS CANDLE CLOSE ABOVE)
bool short_condition2 = (PREVIOUS CANDLE CLOSE ABOVE upper_band) && (ASK < upper_band) );

if ( (spread <= MaxSpread) && short_condition2 )
{
if( OrderSelect( short_ticket_number, SELECT_BY_TICKET) && (short_ticket_number != -1) )
{
if ( (OrderCloseTime() > 0) && (Time[0] > OrderOpenTime()) ){ ok_to_short = true; }
}
if ( short_ticket_number == -1 ) { ok_to_short = true; }

if ( ok_to_short /*&& (slope_value < 0.6) */) TAKE SLOPE OUT
{
TradeComment = StringConcatenate( "short: ", Bid, "/"/*, slope_value*/ );
//MagicNumber = 1000;
short_ticket_number = openMarketOrder( OP_SELL, TradeComment, CLR_NONE, MagicNumber_Normal, MyLotSize, 0 );
}
}

// Short – end

Any help much appreciated.
Allan
User avatar
zentauro67
Trader
Posts: 441
Joined: Fri Mar 01, 2013 4:41 pm
Location: Spain

Re: TMA_CG: EA to buy at support & sell at resistance

Post by zentauro67 »

@forextra

Candle closing back above/below the band can be too slow for scalping. If you find a momentum candle the entry will fail. Best way I know to detect a resuming trend signal is the cross of 5 x 6 EMA. If you take the next cross (after a candle close out of the band) you´ll be earlier in the trade. Sometimes this cross matchs the close above/below the band, but often gives better entries.
Imagen 001.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
forextra
Trader
Posts: 42
Joined: Tue Mar 12, 2013 12:34 pm
Location: Perth, Australia

Re: TMA_CG: EA to buy at support & sell at resistance

Post by forextra »

zentauro67 » Sun Jan 26, 2014 10:10 pm wrote:@forextra

Candle closing back above/below the band can be too slow for scalping.
Thanks zentauro but I think you misunderstood my question. I'm not looking or waiting for a closed candle back into the band. I'm wanting to trade the moment price crosses back into the band. Your bands are showing different to mine but in the image you presented I would have caught a very good trade at 90.6136 and take profit 90.0375 less spreads.
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Re: TMA_CG: EA to buy at support & sell at resistance

Post by dudest »

Hey guys!

Great work that has been going on in here! ( development & testing ), major respect! :)

@Spidey: great stuff with the work on the indis!, have downloaded and checking it out :)

@Andy: great stuff with the MultiTrader!, putting it on demo now and reading through the code [ nice :) ]

Cheers
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Re: TMA_CG: EA to buy at support & sell at resistance

Post by dudest »

AGT » Fri Jan 24, 2014 7:54 pm wrote:@dudest: I see your MFXB link in post #1 being "private" ?
Could you reopen it ? I think someone here is interested to follow your success ...
Hey AGT,

Apologies, had to take the demos down coz needed the processing power on the VPS for further tests :/
vadlapatis

Re: TMA_CG: EA to buy at support & sell at resistance

Post by vadlapatis »

MrLong » Fri Jan 24, 2014 8:45 pm wrote:Hi dudest,


I've coded a multi trader with your strategy, feel free to change it as you please.

I've kept it simple but I have run it today and got a 10% return.

Because it draws its data from a custom indi, loading is a little slow, but you can select to load without the bands on display which is quicker.

You will need to install :
mt4gui.dll
mt4gui.mqh

From here: http://www.mt4gui.com/download/

Best Regards

Andy

Getting Errors
screenshot.jpg
You do not have the required permissions to view the files attached to this post.
dudest
Trader
Posts: 1847
Joined: Tue May 08, 2012 2:37 pm

Re: TMA_CG: EA to buy at support & sell at resistance

Post by dudest »

SpiderX » Sat Jan 25, 2014 7:43 pm wrote: Hi,

Attached is TMACGKumo_NoRepaint.
..
Hey SpiderX!

I'm getting the below error when I call TMACGKumoNoRepaint from EA:

15:51:37 TMACGKumoNoRepaint XAUUSD,M15: ArrayInitialize function internal error

Visually it's loading OK

Cheers!
User avatar
SpiderX
Trader
Posts: 554
Joined: Thu Aug 22, 2013 4:50 pm

Re: TMA_CG: EA to buy at support & sell at resistance

Post by SpiderX »

dudest » Mon Jan 27, 2014 10:14 pm wrote:
Hey SpiderX!

I'm getting the below error when I call TMACGKumoNoRepaint from EA:

15:51:37 TMACGKumoNoRepaint XAUUSD,M15: ArrayInitialize function internal error

Visually it's loading OK

Cheers!
Hi dudest,

Have checked the code. the error is of no consequence to the code function, but i have released a new version to remove this error in my original post.
Btw, since price action is your speciality...have you considered how accurate is price action at each of these boundaries ?
i.e Buy on bullish engulfing/ double bullish engulfing on or below the lower band, or sell on bearish engulfing on or above the upper band , bi-directional in the middle.
Keep it simple and do only bullish/ bearish engulfing.
These may show some promise on the H4 or daily chart.

Cheers
"Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It does not dishonor others, it is not self-seeking, it is not easily angered, it keeps no record of wrongs.Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres."
-Corinthians 13:4-8
Post Reply

Return to “Automated trading systems”