Nanningbob 10.2 auto-trading EA
-
quanttraderjoe
- Trader
- Posts: 65
- Joined: Sat Feb 04, 2012 3:28 pm
Re: 10.2; the auto-trading EA is born.
hello Steve,
i've tried version 1n, its great cos the stoploss works well..i put 75 in the stoploss field n it works very well..but there's a problem, i had a short eur/usd trade that went to 100pips profit cos it hit the tp of the weekly support...after that...no more short eur/usd trades even though the conditions were met.. so missed out on the continued downward moves.
do i have to set "every tick mode" to true?
also for version 1t, i put the stoploss of 75 pips..but the ea uses a 7.5pip stop...i tried using 750pips..n same thing..the ea still uses a 7.5pip stop. very weird.
appreciate your help as always. thanks.
i've tried version 1n, its great cos the stoploss works well..i put 75 in the stoploss field n it works very well..but there's a problem, i had a short eur/usd trade that went to 100pips profit cos it hit the tp of the weekly support...after that...no more short eur/usd trades even though the conditions were met.. so missed out on the continued downward moves.
do i have to set "every tick mode" to true?
also for version 1t, i put the stoploss of 75 pips..but the ea uses a 7.5pip stop...i tried using 750pips..n same thing..the ea still uses a 7.5pip stop. very weird.
appreciate your help as always. thanks.
-
phil_trade
Re: 10.2; the auto-trading EA is born.
Steve
The last version has always the bug I mentionned in this post :
I just saw you took the wrong code just before I edit my post for StopLevel SL/TP calculation
it's Bid-take <= Stoplevel*Point) and NOT Bid-take <= Stoplevel/Point)
4 times in calculate SL BUY/SELL and Calculate TP Buy/Sell.
Philippe
The last version has always the bug I mentionned in this post :
I just saw you took the wrong code just before I edit my post for StopLevel SL/TP calculation
it's Bid-take <= Stoplevel*Point) and NOT Bid-take <= Stoplevel/Point)
4 times in calculate SL BUY/SELL and Calculate TP Buy/Sell.
Philippe
-
spotdespot
- Trader
- Posts: 768
- Joined: Sun Jan 22, 2012 11:38 pm
Re: 10.2; the auto-trading EA is born.
There seems to be an issue with the partial close function somewhere (I am pretty sure this wasn't there prior to version 1s).
My orders are for 0.03 lots, close_lots 0.01, preserve_lots 0.01. It seems to close 2 parts of the order very quickly and even at a loss, then can't adjust the SL and continually modifies it between 2 values - see below.
I will take a look at the code in the morning (UK time) and hopefully work out what is going on!
EDIT - it may be that Philippe has just posted the answer above whilst I was writing this - looking at the timing I just didn't refresh.
My orders are for 0.03 lots, close_lots 0.01, preserve_lots 0.01. It seems to close 2 parts of the order very quickly and even at a loss, then can't adjust the SL and continually modifies it between 2 values - see below.
I will take a look at the code in the morning (UK time) and hopefully work out what is going on!
EDIT - it may be that Philippe has just posted the answer above whilst I was writing this - looking at the timing I just didn't refresh.
You do not have the required permissions to view the files attached to this post.
-
phil_trade
Re: 10.2; the auto-trading EA is born.
No it's due to prior Steve's modification on JumpingStopLoss()spotdespot wrote:There seems to be an issue with the partial close function somewhere (I am pretty sure this wasn't there prior to version 1s).
My orders are for 0.03 lots, close_lots 0.01, preserve_lots 0.01. It seems to close 2 parts of the order very quickly and even at a loss, then can't adjust the SL and continually modifies it between 2 values - see below.
I will take a look at the code in the morning (UK time) and hopefully work out what is going on!![]()
EDIT - it may be that Philippe has just posted the answer above whilst I was writing this!!
Steve I have to restore line code for BUY -> if (sl < OrderOpenPrice() ) return;//Not at breakeven yet
and for SELL -> if (sl > OrderOpenPrice() ) return;//Not at breakeven yet
and this line is quite enigmatic for me - Always return 0 no ?
Code: Select all
if (sl == 0) sl = MathMin(sl, OrderOpenPrice());//No hidden stop loss line-
jjasper7
- Trader
- Posts: 87
- Joined: Mon Mar 19, 2012 11:44 pm
- Location: Mesa,AZ (near Phoenix)
Re: 10.2; the auto-trading EA is born.
can anyone suggest what to look at for a solution to the problem that my platform has only opened 'WPC range trades'? (no trend trades for 5 days running on several charts.)
-
spotdespot
- Trader
- Posts: 768
- Joined: Sun Jan 22, 2012 11:38 pm
Re: 10.2; the auto-trading EA is born.
Thanks Philippe.
- John
- Trader
- Posts: 70
- Joined: Wed Nov 16, 2011 5:34 pm
- Location: Land of Entrapment (New Mexico)
Re: 10.2; the auto-trading EA is born.
FYI, I exerienced the same issue with the partial close... I only noticed because I saw a "half trade" floating in the negative which is impossible if I understand the partial close feature correctly... i.e., you would only ever have your full position size floating in the negative, not a partial one...
-
phil_trade
Re: 10.2; the auto-trading EA is born.
Code: Select all
Hijjasper7 wrote:can anyone suggest what to look at for a solution to the problem that my platform has only opened 'WPC range trades'? (no trend trades for 5 days running on several charts.)
It's a bug in the latest version : Steve I think the code should be this
Code: Select all
bool LookForLongTrend(int tf)
{
/*
Returns true if Slope and Woh trend are up, else returns false
- Slope must be >= 0.4
- Woh must be green
*/
if (tf == PERIOD_D1)
{
if (D1SlopeVal < 0.4) return(false);
if (D1WohVal <= 0) return(false);
if (WeeklyDirection != up) return(false);
}//if (tf = PERIOD_D1)
if (tf == LowerTimeFrame)
{
if (LtfSlopeVal < 0.4) return(false);
if (LtfWohVal <= 0) return(false);
if (WeeklyDirection != up) return(false);
}//if (tf = LowerTimeFrame)
//Got this far without returning false, so must be in trend
return(true);
}//End bool LookForLongTrend(int tf)
bool LookForShortTrend(int tf)
{
/*
Returns true if D1 Slope and Woh trend are down, else returns false
- Slope must be <= -0.4
- Woh must be red
*/
if (tf == PERIOD_D1)
{
if (D1SlopeVal > -0.4) return(false);
if (D1WohVal >= 0) return(false);
if (WeeklyDirection != down) return(false);
}//if (tf = PERIOD_D1)
if (tf == LowerTimeFrame)
{
if (LtfSlopeVal > -0.4) return(false);
if (LtfWohVal >= 0) return(false);
if (WeeklyDirection != down) return(false);
}//if (tf == LowerTimeFrame)
//Got this far without returning false, so must be in trend
return(true);
}//End bool LookForShortTrend(int tf)instead of this
Code: Select all
bool LookForLongTrend(int tf)
{
/*
Returns true if Slope and Woh trend are up, else returns false
- Slope must be >= 0.4
- Woh must be green
*/
if (tf == PERIOD_D1)
{
if (D1SlopeVal < 0.4) return(false);
if (D1WohVal <= 0) return(false);
if (WeeklyDirection <= up) return(false);
}//if (tf = PERIOD_D1)
if (tf == LowerTimeFrame)
{
if (LtfSlopeVal < 0.4) return(false);
if (LtfWohVal <= 0) return(false);
if (WeeklyDirection <= up) return(false);
}//if (tf = LowerTimeFrame)
//Got this far without returning false, so must be in trend
return(true);
}//End bool LookForLongTrend(int tf)
bool LookForShortTrend(int tf)
{
/*
Returns true if D1 Slope and Woh trend are down, else returns false
- Slope must be <= -0.4
- Woh must be red
*/
if (tf == PERIOD_D1)
{
if (D1SlopeVal > -0.4) return(false);
if (D1WohVal >= 0) return(false);
if (WeeklyDirection <= down) return(false);
}//if (tf = PERIOD_D1)
if (tf == LowerTimeFrame)
{
if (LtfSlopeVal > -0.4) return(false);
if (LtfWohVal >= 0) return(false);
if (WeeklyDirection <= down) return(false);
}//if (tf == LowerTimeFrame)
//Got this far without returning false, so must be in trend
return(true);
}//End bool LookForShortTrend(int tf)-
mackaozy
- Trader
- Posts: 190
- Joined: Sat Mar 17, 2012 1:22 pm
Re: 10.2; the auto-trading EA is born.
Hi Philphil_trade wrote:Code: Select all
Hijjasper7 wrote:can anyone suggest what to look at for a solution to the problem that my platform has only opened 'WPC range trades'? (no trend trades for 5 days running on several charts.)
It's a bug in the latest version : Steve I think the code should be this
Code: Select all
bool LookForLongTrend(int tf) { /* Returns true if Slope and Woh trend are up, else returns false - Slope must be >= 0.4 - Woh must be green */ if (tf == PERIOD_D1) { if (D1SlopeVal < 0.4) return(false); if (D1WohVal <= 0) return(false); if (WeeklyDirection != up) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal < 0.4) return(false); if (LtfWohVal <= 0) return(false); if (WeeklyDirection != up) return(false); }//if (tf = LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForLongTrend(int tf) bool LookForShortTrend(int tf) { /* Returns true if D1 Slope and Woh trend are down, else returns false - Slope must be <= -0.4 - Woh must be red */ if (tf == PERIOD_D1) { if (D1SlopeVal > -0.4) return(false); if (D1WohVal >= 0) return(false); if (WeeklyDirection != down) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal > -0.4) return(false); if (LtfWohVal >= 0) return(false); if (WeeklyDirection != down) return(false); }//if (tf == LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForShortTrend(int tf)
instead of this
It's OK now for me.Code: Select all
bool LookForLongTrend(int tf) { /* Returns true if Slope and Woh trend are up, else returns false - Slope must be >= 0.4 - Woh must be green */ if (tf == PERIOD_D1) { if (D1SlopeVal < 0.4) return(false); if (D1WohVal <= 0) return(false); if (WeeklyDirection <= up) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal < 0.4) return(false); if (LtfWohVal <= 0) return(false); if (WeeklyDirection <= up) return(false); }//if (tf = LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForLongTrend(int tf) bool LookForShortTrend(int tf) { /* Returns true if D1 Slope and Woh trend are down, else returns false - Slope must be <= -0.4 - Woh must be red */ if (tf == PERIOD_D1) { if (D1SlopeVal > -0.4) return(false); if (D1WohVal >= 0) return(false); if (WeeklyDirection <= down) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal > -0.4) return(false); if (LtfWohVal >= 0) return(false); if (WeeklyDirection <= down) return(false); }//if (tf == LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForShortTrend(int tf)
Any chance you could please post with the fix?
Cheers
Steve
-
phil_trade
Re: 10.2; the auto-trading EA is born.
Hmmm...It's up to steve to do that ! It's his home heremackaozy wrote:Hi Philphil_trade wrote:Code: Select all
Hijjasper7 wrote:can anyone suggest what to look at for a solution to the problem that my platform has only opened 'WPC range trades'? (no trend trades for 5 days running on several charts.)
It's a bug in the latest version : Steve I think the code should be this
Code: Select all
bool LookForLongTrend(int tf) { /* Returns true if Slope and Woh trend are up, else returns false - Slope must be >= 0.4 - Woh must be green */ if (tf == PERIOD_D1) { if (D1SlopeVal < 0.4) return(false); if (D1WohVal <= 0) return(false); if (WeeklyDirection != up) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal < 0.4) return(false); if (LtfWohVal <= 0) return(false); if (WeeklyDirection != up) return(false); }//if (tf = LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForLongTrend(int tf) bool LookForShortTrend(int tf) { /* Returns true if D1 Slope and Woh trend are down, else returns false - Slope must be <= -0.4 - Woh must be red */ if (tf == PERIOD_D1) { if (D1SlopeVal > -0.4) return(false); if (D1WohVal >= 0) return(false); if (WeeklyDirection != down) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal > -0.4) return(false); if (LtfWohVal >= 0) return(false); if (WeeklyDirection != down) return(false); }//if (tf == LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForShortTrend(int tf)
instead of this
It's OK now for me.Code: Select all
bool LookForLongTrend(int tf) { /* Returns true if Slope and Woh trend are up, else returns false - Slope must be >= 0.4 - Woh must be green */ if (tf == PERIOD_D1) { if (D1SlopeVal < 0.4) return(false); if (D1WohVal <= 0) return(false); if (WeeklyDirection <= up) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal < 0.4) return(false); if (LtfWohVal <= 0) return(false); if (WeeklyDirection <= up) return(false); }//if (tf = LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForLongTrend(int tf) bool LookForShortTrend(int tf) { /* Returns true if D1 Slope and Woh trend are down, else returns false - Slope must be <= -0.4 - Woh must be red */ if (tf == PERIOD_D1) { if (D1SlopeVal > -0.4) return(false); if (D1WohVal >= 0) return(false); if (WeeklyDirection <= down) return(false); }//if (tf = PERIOD_D1) if (tf == LowerTimeFrame) { if (LtfSlopeVal > -0.4) return(false); if (LtfWohVal >= 0) return(false); if (WeeklyDirection <= down) return(false); }//if (tf == LowerTimeFrame) //Got this far without returning false, so must be in trend return(true); }//End bool LookForShortTrend(int tf)
Any chance you could please post with the fix?
Cheers
Steve
but you can Cut and paste the code and compile it !