Best Bob
-
phil_trade
Best Bob
Steve
"Most people go ootb and the magics are different by default" -> Between Trade and CT trade but are equal for each SYMBOL !
More, the last bug I found in BOB EA in Close Procedure was a bad Ticket Number / Symbol association that was corrected by adding an OrderSelect().
"Most people go ootb and the magics are different by default" -> Between Trade and CT trade but are equal for each SYMBOL !
More, the last bug I found in BOB EA in Close Procedure was a bad Ticket Number / Symbol association that was corrected by adding an OrderSelect().
-
phil_trade
Best Bob
Hi Steve
In LookForTradeClosure routine the test if (CloseEnough(DailyStochMain, 0)) in the same for SELL and BUY trades ?
is this abug as for sell it should be if (CloseEnough(DailyStochMain, 100)) ?
In LookForTradeClosure routine the test if (CloseEnough(DailyStochMain, 0)) in the same for SELL and BUY trades ?
is this abug as for sell it should be if (CloseEnough(DailyStochMain, 100)) ?
Code: Select all
if (OrderType() == OP_SELL)
{
if (UseDailyStochForExit==true)
{
//Reset FirstFlipTime if the yellow is the corrrect value
if (!CloseEnough(DailyStochMain, 0))
FirstFlipTime = 0;
//Take the time the line flips
if (CloseEnough(DailyStochMain, 0))
if (FirstFlipTime == 0)
FirstFlipTime = TimeCurrent();
//Is it time to close the trade?
if (CloseEnough(DailyStochMain, 0))
if (FirstFlipTime > 0)
if (TimeCurrent() - FirstFlipTime >= (MinutesToConfirmYellowFlip) )
{
CloseThisTrade = true;
reason = StringConcatenate(Symbol() + " Yellow flip. Closing ticket no " + OrderTicket() + " Blue = " + DoubleToStr(dStochMain[0], 2) + " Yellow = "
+ DoubleToStr(DailyStochMain, 0) + " Red = " + DoubleToStr(WeeklyStochMain, 0));
}//if (TimeCurrent() - FirstFlipTime >= (MinutesToConfirmYellowFlip ) )
/*if (NewBar(PERIOD_M5))-
phil_trade
Best Bob
With BreakEven allowed I have bug alert : Invalid Stop Loss cause GBPJPY wants to Move SL of EUCAD trade ....
just stop this with :
but it seems there's a mess in Symbol and/or Trade management :
just stop this with :
but it seems there's a mess in Symbol and/or Trade management :
Code: Select all
void BreakEvenStopLoss() // Move stop loss to breakeven
{
if (OrderSymbol() != Symbol()) return;- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Best Bob
You are dead right herephil_trade » Thu May 08, 2014 8:53 am wrote:Hi Steve
In LookForTradeClosure routine the test if (CloseEnough(DailyStochMain, 0)) in the same for SELL and BUY trades ?
is this abug as for sell it should be if (CloseEnough(DailyStochMain, 100)) ?
Code: Select all
if (OrderType() == OP_SELL) { if (UseDailyStochForExit==true) { //Reset FirstFlipTime if the yellow is the corrrect value if (!CloseEnough(DailyStochMain, 0)) FirstFlipTime = 0; //Take the time the line flips if (CloseEnough(DailyStochMain, 0)) if (FirstFlipTime == 0) FirstFlipTime = TimeCurrent(); //Is it time to close the trade? if (CloseEnough(DailyStochMain, 0)) if (FirstFlipTime > 0) if (TimeCurrent() - FirstFlipTime >= (MinutesToConfirmYellowFlip) ) { CloseThisTrade = true; reason = StringConcatenate(Symbol() + " Yellow flip. Closing ticket no " + OrderTicket() + " Blue = " + DoubleToStr(dStochMain[0], 2) + " Yellow = " + DoubleToStr(DailyStochMain, 0) + " Red = " + DoubleToStr(WeeklyStochMain, 0)); }//if (TimeCurrent() - FirstFlipTime >= (MinutesToConfirmYellowFlip ) ) /*if (NewBar(PERIOD_M5))
Not even a hint of a clue how that happened folks, but somehow I managed to upload a faulty version. V 1b is in post 1 with the fix. CT trading turned back on by default, so let's see if the trades open and close properly now.
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.
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.
-
phil_trade
Best Bob
Stevephil_trade » Today, 11:47 wrote:With BreakEven allowed I have bug alert : Invalid Stop Loss cause GBPJPY wants to Move SL of EUCAD trade ....
just stop this with :
but it seems there's a mess in Symbol and/or Trade management :
Code: Select all
void BreakEvenStopLoss() // Move stop loss to breakeven { if (OrderSymbol() != Symbol()) return;
I think I have found the problem with this example above. The problem occur when a new GBPJPY trade was generated. the Chart GBPJPY try to modify an EURCAD trade and calculate a wrong SL value.
I guess that the problem come that BOB EA is a single Symbol EA and we run it on multiple charts. When one chart is in CountOpenTrades() module, and another chart add or close a trade, then the loop
Code: Select all
for (int cc = OrdersTotal() - 1; cc >= 0; cc--)and this problem could occur for all loops like this one !
- SpiderX
- Trader
- Posts: 554
- Joined: Thu Aug 22, 2013 4:50 pm
Best Bob
Hi phil,phil_trade » Thu May 08, 2014 7:54 pm wrote:
Steve
I think I have found the problem with this example above. The problem occur when a new GBPJPY trade was generated. the Chart GBPJPY try to modify an EURCAD trade and calculate a wrong SL value.
I guess that the problem come that BOB EA is a single Symbol EA and we run it on multiple charts. When one chart is in CountOpenTrades() module, and another chart add or close a trade, then the loopis disturbedCode: Select all
for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
and this problem could occur for all loops like this one !
Wow...cant believe you caught this.
Wonder what are the chances for this to happen.
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
-Corinthians 13:4-8
-
phil_trade
Best Bob
it's happen to me this afternoon... error message just fire after the second a new trade on GBPJPY... there are 25 charts running... so a lot of possibilities to crunch.SpiderX » 8 minutes ago wrote:Hi phil,phil_trade » Thu May 08, 2014 7:54 pm wrote:
Steve
I think I have found the problem with this example above. The problem occur when a new GBPJPY trade was generated. the Chart GBPJPY try to modify an EURCAD trade and calculate a wrong SL value.
I guess that the problem come that BOB EA is a single Symbol EA and we run it on multiple charts. When one chart is in CountOpenTrades() module, and another chart add or close a trade, then the loopis disturbedCode: Select all
for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
and this problem could occur for all loops like this one !
Wow...cant believe you caught this.
Wonder what are the chances for this to happen.
Cheers
Need to code to filter better Symbol().
I have to add this
Code: Select all
if (OrderSymbol() != Symbol()) return;- SpiderX
- Trader
- Posts: 554
- Joined: Thu Aug 22, 2013 4:50 pm
Best Bob
The below can be a possible fix, though i can already imagine how it might fail...if you got multiple orders opening and closing at the same time.
Not perfect, but guess....it could work ?
Cheers
Not perfect, but guess....it could work ?
Cheers
Code: Select all
int InitialOrdersTotal = OrdersTotal();
for (int cc = InitialOrdersTotal - 1; cc >= 0; cc--)
{
if(OrdersTotal()!= InitialOrdersTotal)
{
InitialOrdersTotal = OrdersTotal();
cc= InitialOrdersTotal -1;
continue;
}
..............
}
"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
-Corinthians 13:4-8
-
phil_trade
Best Bob
I will test that. for now I have to add thisSpiderX » 1 minute ago wrote:The below can be a possible fix, though i can already imagine how it might fail...if you got multiple orders opening and closing at the same time.
Not perfect, but guess....it could work ?
Cheers
Code: Select all
int InitialOrdersTotal = OrdersTotal(); for (int cc = InitialOrdersTotal - 1; cc >= 0; cc--) { if(OrdersTotal()!= InitialOrdersTotal) { InitialOrdersTotal = OrdersTotal(); cc= InitialOrdersTotal -1; continue; } .............. }
Code: Select all
if (OrderSymbol() != Symbol()) return;-
phil_trade
Best Bob
May be it will be safer to EXIT the loop if if(OrdersTotal()!= InitialOrdersTotal) and wait next tick ? this should avoid all add/close trade interference ?phil_trade » 15 minutes ago wrote:SpiderX » 1 minute ago wrote:The below can be a possible fix, though i can already imagine how it might fail...if you got multiple orders opening and closing at the same time.
Not perfect, but guess....it could work ?
Cheers
Code: Select all
int InitialOrdersTotal = OrdersTotal(); for (int cc = InitialOrdersTotal - 1; cc >= 0; cc--) { if(OrdersTotal()!= InitialOrdersTotal) { InitialOrdersTotal = OrdersTotal(); cc= InitialOrdersTotal -1; continue; } .............. }