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

TMA_CG: EA to buy at support & sell at resistance
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3372
Page 25 of 30
Author:  SpiderX [ Sat Jan 25, 2014 4:43 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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
Author:  pete14 [ Sat Jan 25, 2014 6:31 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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

Cheers
Author:  forextra [ Sun Jan 26, 2014 8:10 am ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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
Author:  zentauro67 [ Sun Jan 26, 2014 2:10 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

@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
Author:  forextra [ Sun Jan 26, 2014 10:12 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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.
Author:  dudest [ Mon Jan 27, 2014 9:10 am ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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
Author:  dudest [ Mon Jan 27, 2014 9:13 am ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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 :/
Author:  vadlapatis [ Mon Jan 27, 2014 1:43 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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
Author:  dudest [ Mon Jan 27, 2014 2:14 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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!
Author:  SpiderX [ Mon Jan 27, 2014 3:07 pm ]
Post subject:  Re: TMA_CG: EA to buy at support & sell at resistance

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
All times are UTC Page 25 of 30