Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
And it would also mean that it would be useless if you had to stop and start the program...it wouldn't manage any existing orders because the magic number would be different.
And it would also mean that there would be a possibility of conflicting with the magic number of another EA, whether running in the same or another instance of the terminal, if it was running on the same account.
but magic numbers are static for each pair inside the code. the random number gen would provide a dynamic num each time the script is run preventing what are all too common magic num problems. and eliminate a big chunk of redundant code.
I think hes talking about some thing like this
Code:
//«« <<<< Get Tag Number, Function Routine >>>> »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
int
GetTagNumber() {
int PullNumber = Empty;
if( GlobalVariableCheck( "PullTag ( Do Not Delete )" )) {
PullNumber = GlobalVariableGet( "PullTag ( Do Not Delete )" );
} else {
PullNumber = StartTag;
} // End If, GlobalVariableCheck:
GlobalVariableSet( "PullTag ( Do Not Delete )", PullNumber + One );
if( GlobalVariableGet( "PullTag ( Do Not Delete )" ) > EndTag ) {
GlobalVariableSet( "PullTag ( Do Not Delete )", StartTag );
} // End If, GlobalVariableSet:
return( PullNumber );
} // End Function Procedure, GetTagNumber:
[edit] I forgot, you can track each oder independently with the use of OrderPortion veriable in this example you can track 100 open trades with the same system run. If your magicnumber is say 123 and you multiplied it by OrderPortion your number would be 12300. the first 3 digits are your magic number the last two track your orders.
Code:
// ««« SYSTEM DEFAULT PARAMETER SECTION: »»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»
bool
HoldDirection = False, // Holds last win direction to start new campaign.
UseMarketBias = False, // Market direction determines first level deployment.
AutoProfitSizing = False, // ProfitTarget will be derived from market conditions.
AutoTunnelSizing = False, // Tunnel size will be derived from market conditions.
AutoLotSizing = False, // Bases base lot size to current account size.
UseStopLoss = False, // Switch on and off the use of stoploss orders.
UseTakeProfits = False, // Switch to apply Take Profit exits.
UseEmergencyExits = False, // Switch for the the use of emergency sever base exits.
PlaySoundAlerts = False, // Enables sound wave to be played on triggered alerts.
WriteToLogs = False, // Turns on systems Activity Record Functions.
TrackPerformace = False, // Turns on system Performace Record Functions.
UserIntervention = False, // Ability to manually over ride system during its run.
ErrorOverRide = False, // BuiltIn system error recovery functions.
DeBugMessages = True; // Turns on and off functions for code debuging.
int
DefaultDirection = Long, // Default setting for initial system start up.
ScreenInformation = All, // Switches system information screens.
AvailableScreens = 7, // Maximum information screen available for viewing.
ScreenViewingTime = 15, // Length of time screen is visiable (in Ticks).
PauseInterval = 10000, // Pause interval between order placements (10sec).
MaximumAttempts = 2, // Repeated order execution on failed attempt.
OrderPortion = 100, // Internal portion of Tag number for position tracking.
Slippage = 0, // Sets price slippage for order entry.
MaximumLots = 50, // Maximum net lots permitted by your broker.
RiskLevel = 1, // Varible, 1 to 5: One being the lowest risk level.
EmergencyExitLevel = 30, // The emergency exit level to mantain on all open orders.
MaximumPositions = 10, // Maximum trade levels that will be mantained.
MarketStudyPeriod = 13; // Data length to determine Market conditional Bias.
Last edited by cockeyedcowboy; 12-23-2006 at 01:13 AM.
but magic numbers are static for each pair inside the code. the random number gen would provide a dynamic num each time the script is run preventing what are all too common magic num problems. and eliminate a big chunk of redundant code.
The code of this EA and most EA's has to rely on a consistent magic number. All of the loops that process orders use symbol and magic number ( and often order type) to identify relevent orders for the specific chart the EA is tied to. You need a way to keep from messing with open orders from another chart. A random number works as long as you don't stop the EA while there's open orders...too messy.
I assume you're referring to that "big chunk of redundant code" in Goblin BiPolar which produces magic numbers. Ask yourself how many times you've placed an EA on multiple charts and forgot to change the built in default magic number, causing orphan orders? For me, that extra block of code that takes nanoseconds to process is worth it's weight. I really don't understand why we're even discussing such a moot point.
The code of this EA and most EA's has to rely on a consistent magic number. All of the loops that process orders use symbol and magic number ( and often order type) to identify relevent orders for the specific chart the EA is tied to. You need a way to keep from messing with open orders from another chart. A random number works as long as you don't stop the EA while there's open orders...too messy.
I assume you're referring to that "big chunk of redundant code" in Goblin BiPolar which produces magic numbers. Ask yourself how many times you've placed an EA on multiple charts and forgot to change the built in default magic number, causing orphan orders? For me, that extra block of code that takes nanoseconds to process is worth it's weight. I really don't understand why we're even discussing such a moot point.
First of I congratulate you and all involved in the development of the Goblin EA series. Personally i am a big fan of the Martingale progression method with all its might and weakness.
I have taken the liberty to run several back-tests on the latest Goblin release in visual mode to determine its behavior with the new modifications that you have implemented.
I think the two order execution engines within one EA is a clever idea and yet sets a new level of MQ4 coding both engines work in harmony each managing its own side of the trade; excellent work.
I am hoping i can contribute to the development of the EA in a positive manner and to begin my contribution i would like to list an observation that i have noticed in the EA execution.
I have noticed that the trailing stop for the short order is not functioning. Only long orders have their stops modified as the market moves in a favorable direction and all positions close with the correct minimum profit captured. It is not the case however with the short orders. Short orders tend to only close when the P/T for the last position in the cycle is reached. I have noticed that on many occasion the market retraces enough (beyond the minimum profit value set) but the stop is not modified and thus more often than not a profitable cycle ends up extending unnecessarily.
I plan on analyzing the log one more time to re confirm my observation. I also invite you and others to confirm my observation. If i am found to be in error or my settings are the cause, kindly point out my error for my future reference.
Thank you for taking the time to read my post and for your generous contribution to the forum.
First of I congratulate you and all involved in the development of the Goblin EA series. Personally i am a big fan of the Martingale progression method with all its might and weakness.
I have taken the liberty to run several back-tests on the latest Goblin release in visual mode to determine its behavior with the new modifications that you have implemented.
I think the two order execution engines within one EA is a clever idea and yet sets a new level of MQ4 coding both engines work in harmony each managing its own side of the trade; excellent work.
I am hoping i can contribute to the development of the EA in a positive manner and to begin my contribution i would like to list an observation that i have noticed in the EA execution.
I have noticed that the trailing stop for the short order is not functioning. Only long orders have their stops modified as the market moves in a favorable direction and all positions close with the correct minimum profit captured. It is not the case however with the short orders. Short orders tend to only close when the P/T for the last position in the cycle is reached. I have noticed that on many occasion the market retraces enough (beyond the minimum profit value set) but the stop is not modified and thus more often than not a profitable cycle ends up extending unnecessarily.
I plan on analyzing the log one more time to re confirm my observation. I also invite you and others to confirm my observation. If i am found to be in error or my settings are the cause, kindly point out my error for my future reference.
Thank you for taking the time to read my post and for your generous contribution to the forum.
Regards,
Thanks for the great feedback, Pip. I'm going to be looking at that code over the weekend because you're not the first to notice this. I did make a few tweaks to the EA and reposted on the first page...have you downloaded and tried this latest version? It's possible something got muffed up when I built this thing in a bit of a hurry...I was curious about what xxDavidxSxx was doing and wanted to try automating it. Let me know if your test observations were based on the latest version. Thanks!
Thanks for the great feedback, Pip. I'm going to be looking at that code over the weekend because you're not the first to notice this. I did make a few tweaks to the EA and reposted on the first page...have you downloaded and tried this latest version? It's possible something got muffed up when I built this thing in a bit of a hurry...I was curious about what xxDavidxSxx was doing and wanted to try automating it. Let me know if your test observations were based on the latest version. Thanks!
I downloaded the EA yesterday morning after you had tweeked the order entry bug. I did not notice the expert missing any sequential entries, only that it is not trailing the short order. I looked at the code to determine where the bug may be but was not able to identify it. I will download the EA again today and re test it. Cheers.