| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| TMA_CG: EA to buy at support & sell at resistance https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3372 |
Page 7 of 30 |
| Author: | dudest [ Mon Jan 13, 2014 1:26 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Based on recent feedback, I am uploading "TMACG_Gold_M15_STACKING_C" to Post #1 a) Symbol and Magic Number checks added to every fuction --> Symbol needs to be XAU* [ e.g, XAUUSD, XAUUSDm, etc; so long as XAU is in the name ] --> You can now configure Magic Numbers for normal (default: 1000) and stack trades (default: 3000). --> The functions will only operate on the configured magic numbers Code: Select all --> False by default ( for people like me ) --> Default minimum distance to TP to allow for stack trade: 30pips ( only taken to account if AvoidStackingNearTP = true ) Code: Select all For those not needing above two features, you can continue using "TMACG_Gold_M15_STACKING_B" if you don't want to change the one running on Empty4 right now ( no change in core functionality ). Cheers |
|
| Author: | MrLong [ Mon Jan 13, 2014 1:31 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Hi dudest, && should be || Code should be : if ( (OrderMagicNumber() != 1000) || (OrderMagicNumber() != 3000) ) continue; Andy |
|
| Author: | bazze [ Mon Jan 13, 2014 3:01 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Yeah,it seems like this have a potensial |
|
| Author: | dudest [ Mon Jan 13, 2014 4:43 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Hi Andy! Thanks for pointing this out. At first, I thought it should be || (OR), but then it occurred to me that with an OR, you only need one of the tests to evaluate to true for the whole function to be true. So in our case: if ( (OrderMagicNumber() != 1000) || (OrderMagicNumber() != 3000) ) continue; --> If the magic number is not 1000 (say it's 3000): the function will eval to true based on the first condition, and 'continue' will apply (without testing the 2nd condition), wrongly skipping a valid order. So I put: if ( (OrderMagicNumber() != 1000) && (OrderMagicNumber() != 3000) ) continue; --> So that BOTH conditions have to evaluate to true for the particular selected order to be skipped (continue). --> So if a magic number is 3000: second condition fails, function evaluates to false -> order is (rightly) processed --> If a magic number is 100: both conditions eval to true, and order is (rightly) skipped I think the || would apply if I was testing the conditions in order to immediately execute the code for them (as opposed to testing the conditions to remove the unwanted orders). == Please correct me if I'm missing something.... Cheers |
|
| Author: | MrLong [ Mon Jan 13, 2014 5:04 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Hi, && would be checking if the magicnumber is both these value. || would mean if the value is not either of these numbers. So you would be saying if the magic numbers are not either 1000 or 3000 continue, they don't belong to my EA. Edit: Try: if (OrderMagicNumber() != 1000) continue; if (OrderMagicNumber() != 3000) continue; Edit: I've just run a test and I'm wrong, your code works. Sorry Andy |
|
| Author: | dudest [ Mon Jan 13, 2014 6:30 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Ver "TMACG_Gold_M15_STACKING_C" uploaded Also contains code to check (when placed on a chart) whether trades belonging to it are already running (to avoid placement of multiple trades of the same type (esp at the same area) ) Also contains LibCSS code as extracted from LibCSS.mqh by SpiderX (thanks Spidey!) Cheers |
|
| Author: | dudest [ Mon Jan 13, 2014 6:34 pm ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
No Andy, I'm grateful that you ran checks, and we are sure that the code works! Thanks Andy Cheers |
|
| Author: | cad0811 [ Tue Jan 14, 2014 5:07 am ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Sorry to disturb you!I test the C version, if currencies have the suffix, still doesn't work, thank you!When no suffix is working. Supplement: I use roboforex two accounts to test, a suffix, without a suffix. Thank you again for your work! |
|
| Author: | varso [ Tue Jan 14, 2014 6:42 am ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
I confirm this problem. I have also roboforex and the name for gold is XAUUSD.m with "m" like suffix. And many others brokers have suffix. Please if you can repair this problem it will be very grateful. Thank you |
|
| Author: | dudest [ Tue Jan 14, 2014 7:19 am ] |
| Post subject: | Re: TMA_CG: EA to buy at support & sell at resistance |
Hi guys, Thanks for your feedback! Could either of you please post up a VERY CLEAR chart of your XAUUSD.m also showing the F9 (quotes) window? ( i.e, open up XAUUSD.m, remove indis & whatnot, change the scheme to something clear (e.g black over white), press F9, then take screenshot and upload ) I haven't hard-coded names anywhere, so I'm wondering whether your Digits are off? (affects the Pip Factor) Also check your Journal and Experts tabs for ANY errors and paste those too if you find them Cheers |
|
| All times are UTC | Page 7 of 30 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|