Flying Slope auto-trading EA

Post Reply
zkucera
Posts: 7
Joined: Tue Nov 15, 2011 11:04 pm

Re: Flying Slope auto-trading EA

Post by zkucera »

Hi Steve,

I looked into the indicator and I think there is a small bug.

In this section of code

Code: Select all

      for (i=MaxBars; i>=0; i--)
      {
         if (signalDN[i]!=EMPTY_VALUE)
            signalDN[i]=High[i]+offset;
         if (signalUP[i]!=EMPTY_VALUE)
            signalUP[i]=Low[i]-offset;
      }
signalDN, High, signalUP and Low all reference the same bar.

Few lines down, Low references the previous bar compared to other three.

Code: Select all

      //-- short signal
      if (Draw_SellSignals && dLow>MathMax(EMAfast[i1],EMAslow[i1]))
         signalDN[i1]=High[i1]+offset;
         
      //-- long signal
      if (Draw_BuySignals && dHigh<MathMin(EMAfast[i1],EMAslow[i1]))
         signalUP[i1]=Low[i]-offset;
Not sure if that was intentional or not, but looks wrong to me. Is SwingMan on this forum (I think so, but not 100% sure)? He might be able to advise.

EDIT: Attempt to highlight sections of code in bold or red failed, I have yet to learn how to do it :-(

Cheers,
Z
meirk
Trader
Posts: 20
Joined: Sun Apr 01, 2012 12:13 pm

Re: Flying Slope auto-trading EA

Post by meirk »

SteveHopwood wrote:
zkucera wrote:
SteveHopwood wrote:
In Crapergy testing, FS would take and close a trade, then shut up shop. The problem turns out to be in IsTradingAllowed(). The call to TooClose() in IsTradingAllowed() stopped further trading. There is something wrong in TooClose(), but blowed if I can see what. The only way to allow a resumption of trading is to comment out the call to TooClose().
Hi Steve,

I think the problem is in the following line:

Code: Select all

if (OrderCloseTime() - TimeCurrent() < (MinMinutesBetweenTrades * 60))
OrderCloseTime() - TimeCurrent() is always < 0 so the function always returns True.

Cheers,
Zeljko
Oh crap. Thanks. I had this solved at one point and have clearly unsolved it.

For those of you unable to correct this Baby Pips level bloop, the fix is in V 1k in post 1.

Thanks again Zeljco. Your contributions continue to be magnificent.

:D
Steve looked at post 1 I don't see version 1k' or I might not understand?
Romsunz
Posts: 4
Joined: Wed Sep 19, 2012 11:03 am

Re: Flying Slope auto-trading EA

Post by Romsunz »

Hi all
meirk, open mq4 file from p.1 and you will see there is a mark v1k in line 6 :)

Steve, thank you very much for this forum and good ideas you are willing to share with us.
I dont understand mq tester and I dont understand how it handles repainting indicators. I test all my ideas in Amibroker so I have to rewrite code from mq4 to afl.
Here is code to test slope indicator that does not repaint its history values:

Code: Select all

	for (i=eintPeriod+1; i<BarCount; i++)
	{
		dblSum  = float(eintPeriod+1)*Price[i];
		pdblSum  = float(eintPeriod+1)*Price[i-1];
		dblSumw = float(eintPeriod+1);
		for ( j = 1, knx = eintPeriod; j <= eintPeriod; j++, knx-- )
		{
			dblSum  +=  (float)knx * Price[i-j];
			pdblSum  +=  (float)knx * Price[i-j-1];
			dblSumw+= (float)knx;

			dblSum  += ( (float)knx * Price[i] );
			pdblSum  += ( (float)knx * Price[i] );
			dblSumw += (float)knx;
		}
		if (dblSumw!=0)
			res.array[i]=(dblSum/dblSumw)-(pdblSum/dblSumw);
		else res.array[i]=0;
	}

Also I have backtested in Amibroker the Flying Buddah idea and even without filtering it gave me very promissing results, but backtesting your ea in Empty4 gave opposite results with falling equity curve. So could you be so kind to give us your set file to backtest this ea?

Best regards,
Roman
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: Flying Slope auto-trading EA

Post by SteveHopwood »

Romsunz wrote:Hi all
meirk, open mq4 file from p.1 and you will see there is a mark v1k in line 6 :)

Steve, thank you very much for this forum and good ideas you are willing to share with us.
I dont understand mq tester and I dont understand how it handles repainting indicators. I test all my ideas in Amibroker so I have to rewrite code from mq4 to afl.
Here is code to test slope indicator that does not repaint its history values:

Code: Select all

	for (i=eintPeriod+1; i<BarCount; i++)
	{
		dblSum  = float(eintPeriod+1)*Price[i];
		pdblSum  = float(eintPeriod+1)*Price[i-1];
		dblSumw = float(eintPeriod+1);
		for ( j = 1, knx = eintPeriod; j <= eintPeriod; j++, knx-- )
		{
			dblSum  +=  (float)knx * Price[i-j];
			pdblSum  +=  (float)knx * Price[i-j-1];
			dblSumw+= (float)knx;

			dblSum  += ( (float)knx * Price[i] );
			pdblSum  += ( (float)knx * Price[i] );
			dblSumw += (float)knx;
		}
		if (dblSumw!=0)
			res.array[i]=(dblSum/dblSumw)-(pdblSum/dblSumw);
		else res.array[i]=0;
	}

Also I have backtested in Amibroker the Flying Buddah idea and even without filtering it gave me very promissing results, but backtesting your ea in Empty4 gave opposite results with falling equity curve. So could you be so kind to give us your set file to backtest this ea?

Best regards,
Roman
My set file are the release defaults.

: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
Carioca
Trader
Posts: 49
Joined: Sat Jun 09, 2012 12:12 am

Re: Flying Slope auto-trading EA

Post by Carioca »

thanks Steve

It seems that the TF D1 and the best.

I did a quick backtesting and it seems that something is wrong in the TP and SL and placed 200 pips plus the stoploss is not exactly the 200 pips
User avatar
Carioca
Trader
Posts: 49
Joined: Sat Jun 09, 2012 12:12 am

Re: Flying Slope auto-trading EA

Post by Carioca »

Carioca wrote:thanks Steve

It seems that the TF D1 and the best.

I did a quick backtesting and it seems that something is wrong in the TP and SL and placed 200 pips plus the stoploss is not exactly the 200 pips
I managed to leave as I wanted more and ended up using SL TP based on ATR.

Anyone here know where I should edit the code so that it opens a trade every signal.

I was thinking let's say you have 5 arrows then opens a sales venda on each arrow until an arrow appears purchase and close all trades.

And an option to choose a minimum of pips between a sale and another does not make much sense for him to open another venda 5 pips above.
User avatar
cuzgeorge
Trader
Posts: 674
Joined: Mon Mar 05, 2012 10:10 am
Location: Johannesburg, South Africa.

Re: Flying Slope auto-trading EA

Post by cuzgeorge »

Hi all,
started to get some trades late in the week after setting the TF at 240 at using the lower 60M TF for the indi.

Not much to post on, but will elaborate when have more results. So far,3 losers, one winner, and one open, winning position. :D
regards
cuz
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: Flying Slope auto-trading EA

Post by SteveHopwood »

cuzgeorge wrote:Hi all,
started to get some trades late in the week after setting the TF at 240 at using the lower 60M TF for the indi.
Yes, anyone waiting for the D1 to go into trading territory is waiting tradeless for the time being.

Hey ho.

: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: Flying Slope auto-trading EA

Post by cuzgeorge »

Hi Steve, all,
look slike we're getting trades now from FS. I'm attaching my set file and although i'm not thrilled with the results yet, i see a start here that we at least have trades.
i'm running this set file on 6 main pairs, with lower spreads, all on 1HR charts.
I have had trades with this set file, but cant quite get the exit right. Play around with the set, at the mo i have BE turned off, but playing around with the slope values and seeing what else comes up.

I also have MPTM on the same platform and worth noting is that i cant see any trades that MPTM picked up from FS yet. I.E the positions either close before they go into significant losses for MPTM to pick up, or they move on to close by JS or a slope value change.
Good thing to note, i have no errors for a few months and it appears its own MM code is working fine.

I've also used different EA's on the same platform with diff Magics and have had no probs so far. Multi and WB are on the same platform, no obvious clashes, but shout out if you have experienced issues please. I did this for very slow trading EA's as i needed the demo platforms. Results are in the demo list linked under my signature. Look for the 1:200 Markets platform with the EA's names if you' would like to peruse the results and open trades.
regards and have a blast guys.
cuz
You do not have the required permissions to view the files attached to this post.
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
Post Reply

Return to “Automated trading systems”