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

Flying Slope auto-trading EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=680
Page 19 of 28
Author:  fxshadow [ Fri Jul 27, 2012 12:48 pm ]
Post subject:  Re: Flying Slope auto-trading EA

Does anyone have 1C also.
Author:  moondog [ Fri Jul 27, 2012 3:11 pm ]
Post subject:  Re: Flying Slope auto-trading EA

Fxshadow

Here is what looks like a clean version of 1c.
Anyway check it out.

Moondog
Author:  harry45 [ Fri Jul 27, 2012 3:38 pm ]
Post subject:  Re: Flying Slope auto-trading EA

akara wrote:Hi Harry45, can you share the version 1B, I seem to have overwritten mine.

thanks
Here you are
Author:  jiaxingx [ Fri Jul 27, 2012 3:41 pm ]
Post subject:  Re: Flying Slope auto-trading EA

Have anyone use version 1h?

it is not be tested .
Author:  akara [ Fri Jul 27, 2012 11:31 pm ]
Post subject:  Re: Flying Slope auto-trading EA

Thanks Harry, its really in hot demand.
Author:  SteveHopwood [ Fri Jul 27, 2012 11:33 pm ]
Post subject:  Re: Flying Slope auto-trading EA

garyfritz wrote:If risk-based sizing means "calculate the lot size that, given my current SL, would risk X% of my account," then that's the way I **ALWAYS** trade with real money. That's how you implement basic position-sizing strategies like fixed-fractional sizing. If it wasn't supported in an EA, I'd try to fake it with manually-specified lotsizes, but that only works if you know the SL ahead of time.
Not a clue Gary. Also, I am not experiencing a problem here but I have a modern machine with lots of memory.
OK, then I wouldn't see it either.

If anybody who's hitting this CPU issue wants to try an experiment: try the attached. I changed it to only delete/recreate the objects if the price changes. I also completely removed the SendLots calculation, since it's a local variable and it never gets accessed after it's calculated. (Steve, am I missing something there??)

No promises since I can't test it, but see if it helps... (and if it works!!)
Gary, I just had an idea.

I declared OldBarsTime as a datetime. I see from CtapMql4 Help that this is, "Its internal representation is a long integer number of 4 bytes.". Bearing in mind that I do not know the difference between an 'integer' and a 'long integer', is it possible that

Code: Select all

 if (OpenTrades > 0 && StackDistancePips > 0 && OldBarsTime != iTime(NULL, LowerTimeFrame, 0))
   {
         LookForStackTradingOpps();
   }//if (OpenTrades > 0)
fails because some strange CrapMql4 thingy causes OldBarsTime to be out by a gazillionth of a second and therefore the object deletion/replacing code is actually activated at every tick? I don't know how long it takes CrapMql4 to delete then replace an object, but a fiver says it is a while.

How about trying declaring OldBarsTime as an int instead of a datetime?

:D
Author:  garyfritz [ Sat Jul 28, 2012 12:07 am ]
Post subject:  Re: Flying Slope auto-trading EA

"long integer" is 32 bits, "integer" is 16 bits. So a "long integer" can hold a bigger number (about 2 billion vs. 65000). But I don't think MQL supports 16-bit integers. An "int" is a 32-bit integer.

I would keep OldBarsTime as a datetime, since that's what iTime returns. Keep the types matched up to give Empty4 the fewest opportunities to screw it up.

Don't worry about OldBarsTime being off by a gazillionth. It's an integer value, counting the seconds since 1/1/1970. It doesn't do gazillionths.
Author:  jiaxingx [ Sat Jul 28, 2012 5:03 am ]
Post subject:  Re: Flying Slope auto-trading EA

In the function "bool LookForTradeClosure(int ticket)"

if (HtfSlopeTrend == buyhold) return;//Leave open and hope for stack opps

I think that maybe return "false",anyone think that right?
Author:  garyfritz [ Sat Jul 28, 2012 6:43 pm ]
Post subject:  Re: Flying Slope auto-trading EA

Yes, it's a bool function. It should return true or false.

I suspect that MQL defaults to "false" if you don't pass a value, but it's not a good idea to assume. Especially with MQL.
Author:  jiaxingx [ Sun Jul 29, 2012 2:07 am ]
Post subject:  Re: Flying Slope auto-trading EA

Hi,garyfritz
I see many people use "OOTB setting" for testing , I do not know what the mean of "OOTB",
Is that default setting?
thanks!
All times are UTC Page 19 of 28