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 7 of 9
Author:  SpiderX [ Thu May 15, 2014 2:01 pm ]
Post subject:  10.7 trading helpers by Steve and others


Was wondering if it should be

Code: Select all

      if (CloseEnough(DailyStochMain, 0))
         if(CloseEnough(HT2StochMain, 100))
instead of

Code: Select all

      if (DailyStochMain == 0)
         if(HT2StochMain == 100)
Dont think it should be a big deal though.

Cheers
Author:  SteveHopwood [ Thu May 15, 2014 2:07 pm ]
Post subject:  10.7 trading helpers by Steve and others

SpiderX » Thu May 15, 2014 2:01 pm wrote:

Was wondering if it should be

Code: Select all

      if (CloseEnough(DailyStochMain, 0))
         if(CloseEnough(HT2StochMain, 100))
instead of

Code: Select all

      if (DailyStochMain == 0)
         if(HT2StochMain == 100)
Dont think it should be a big deal though.

Cheers
I see - misunderstood. Yes it should, and needs correcting. Bloody crapqlx.

:xm:
Author:  SteveHopwood [ Thu May 15, 2014 2:20 pm ]
Post subject:  10.7 trading helpers by Steve and others

By the by coders, looking for an Experts crapqlx function, I came across a new one - ExpertsRemove(). Help suggests that this causes the ea to be deleted, although I haven't tested this yet.

:xm:
Author:  zader [ Thu May 15, 2014 4:28 pm ]
Post subject:  10.7 trading helpers by Steve and others

SteveHopwood » Thu May 15, 2014 1:05 pm wrote: Thanks zader; you have been invaluable.
Invaluable? I was expecting pain in the arse nuisance but I'll take invaluable.
I'll shut up now with my Spectrum basic programming skills and let SpiderX check the code.
(yes Spectrum basic! google it kids)

Are these good enough to use on live account now??
Author:  SteveHopwood [ Thu May 15, 2014 6:19 pm ]
Post subject:  10.7 trading helpers by Steve and others

zader » Thu May 15, 2014 4:28 pm wrote:
SteveHopwood » Thu May 15, 2014 1:05 pm wrote: Thanks zader; you have been invaluable.
Invaluable? I was expecting pain in the arse nuisance but I'll take invaluable.
I'll shut up now with my Spectrum basic programming skills and let SpiderX check the code.
(yes Spectrum basic! google it kids)
*stares dreamily off into the middle distance* Ahhhhhh, the ZX Spectrum............
Are these good enough to use on live account now??
I wouldn't; let's check them first. They appear to be working ok on my demo.

:xm:
Author:  SteveHopwood [ Thu May 15, 2014 9:12 pm ]
Post subject:  10.7 trading helpers by Steve and others

Following the work of some invaluably helpful contributors, the latest versions of all 8 ea's are in post 1. I strongly recommend that anyone using any of them download the latest.

Still not sure if the single trade line confirmation time thingy is working properly or not. The code appears blindingly obvious to me and I cannot see anything wrong. There again, until zader stepped in, I couldn't see anything wrong anywhere yet the faults are blindingly obvious to anyone with a firing brain cell. Clearly, I do not belong to this august group.

So, thanks for your help guys. I was getting nowhere with all this.

Mind, the next messenger better have very good armour.

:xm:
Author:  kwchau [ Fri May 16, 2014 11:49 am ]
Post subject:  10.7 trading helpers by Steve and others

Here are my test results so far on H1 charts:

For the buy or sell twice trend EAs, there is no waiting time to execute an entry, everything seems fine.

For the single entry trend EAs, the entry still has problem but I think I have figured it out . I used the default waiting time of 2 minutes before taking a trade. If the waiting time finished on the same bar, the trade would be entered correctly. If the waiting time was beyond the current bar, i.e., a new bar formed before the 2 minutes waiting time was up, the EA reset everything at the new bar opening. For example, if price broke stoch 10 one minute before bar close, when the new bar started, everything will be reset. Since at that time, the price has already passed Stoch 10, the EA would wait until price broke the Stoch 30 threshold.

I do not trade counter trend trade, so I haven't tested them but I believe the logic would be the same.
Author:  SteveHopwood [ Sat May 17, 2014 10:01 pm ]
Post subject:  10.7 trading helpers by Steve and others

kwchau » Fri May 16, 2014 11:49 am wrote:Here are my test results so far on H1 charts:

For the buy or sell twice trend EAs, there is no waiting time to execute an entry, everything seems fine.

For the single entry trend EAs, the entry still has problem but I think I have figured it out . I used the default waiting time of 2 minutes before taking a trade. If the waiting time finished on the same bar, the trade would be entered correctly. If the waiting time was beyond the current bar, i.e., a new bar formed before the 2 minutes waiting time was up, the EA reset everything at the new bar opening. For example, if price broke stoch 10 one minute before bar close, when the new bar started, everything will be reset. Since at that time, the price has already passed Stoch 10, the EA would wait until price broke the Stoch 30 threshold.

I do not trade counter trend trade, so I haven't tested them but I believe the logic would be the same.
The EA's decide there is a trade to be taken, then go into a loop that examines the Sto7 for a retreat into an untradable area for however long you chose the waiting time to be. If Sto7 retreats at any point, the trade is cancelled. If not, the ea proceeds to attempt to take the trade on exit from the loop.

If the trade attempt fails, then the ea resumes normal activity. If conditions are still correct for a trade, it starts the cycle again. If not, there is no further attempt to trade.

The Sto7 can scream up and down like an elevator on acid. On the charts and if at the close of the candle, it is the same value as it was at the candle open, in retrospect it will look as though the thing has not moved for the entire 4 hours - yet it might have opened and closed several trades.

That is the downside of using 'confirmation' delays with an indi as sensitive as those being used here. We might not get what we assumed we would get from looking back in time. Bob says he trades when everything else is in place and Sto7 crosses appropriately. He does not await 'confirmation' stuff like 'remained above for x period of time' or 'wait for the candle to close' etc

You might be barking at the wrong moon with all this. Not saying you are, just suggesting you might be.

:xm:

:xm:
Author:  rdg281 [ Sat Jul 05, 2014 9:29 am ]
Post subject:  10.7 trading helpers by Steve and others

Hi Guys :hi:

Is there also an ea (helper) available that only closes the long(s) at the upperband and short(s) at the lower band trade(s) of the true TMA And when it done that. the ea deactivate?
It must only close the longs when you want to, or only the shorts when you want to. (adjustable)(not both at the same time.
Or can somebody make that? That would be very nice and handy :smile:

thx for the answer and have a nice weekend.

Cheers :)

Roberto
Author:  kwchau [ Tue Jul 15, 2014 4:31 pm ]
Post subject:  10.7 trading helpers by Steve and others

Based on Steve's Sell Twice into Trend EA, I have made some changes to the codes such that I can trigger trade based on W1 Stoch 7 and take profit when the D1 Stoch 7 reaches my threshold. There is no other exit strategies. I put the attached amended EA on a D1 chart. It runs ok all along but suddenly today, it keeped opening and closing trades until I removed it manually. :arrrg:

Here are the line that I've made changes:

103 extern int TradingTimeFrame=10080; I changed to 10080 to use W1 Stoch 7

110 extern int Stoch7ExitTF=1440;//added by kwc
111 extern int ExKPeriod=14; //added by kwc
112 extern int ExDPeriod=4; //added by kwc
113 extern int ExSlowing=3; //added by kwc
114 extern int Stoch7ForExitLevel=15; //kwc: close position when stoch 7 reaches this level

153 double DailyStochMainClose; // kwc: added for trade closure based on Daily Stoch 14 4 3 on a D1 chart

1073 to 1078
if (!EveryTickMode)
dStochMain[1]=GetStochastic(Symbol(),TradingTimeFrame,KPeriod,DPeriod,Slowing,Method,Price,MODE_MAIN,shift + 1);
else dStochMain[1]=GetStochastic(Symbol(),TradingTimeFrame,KPeriod,DPeriod,Slowing,Method,Price,MODE_MAIN,shift);
}//if (PrevOldStochBarsTime != iTime(NULL, TradingTimeFrame, 0) )

OldStochBarsTime = iTime(NULL, TradingTimeFrame, 0);
dStochMain[0]=GetStochastic(Symbol(),TradingTimeFrame,KPeriod,DPeriod,Slowing,Method,Price,MODE_MAIN,shift);


1083 DailyStochMainClose=GetStochastic(Symbol(),Stoch7ExitTF,ExKPeriod,ExDPeriod,ExSlowing,Method,Price,MODE_MAIN,shift);

1171 if (DailyStochMainClose <= Stoch7ForExitLevel) CloseThisTrade = true;

My coding skill is nearly zero so I could not figure out what has gone wrong.

I hope I've made myself clear enough so that Steve or some coding gurus in this forum could help me to find out where are the problems and how I could overcome this opening and closing issue. Thanks guys in advance ! :roll:
All times are UTC Page 7 of 9