How come no record for an event as important as REASON_PROFILE in this table, or is there a way to configure it manually or maybe it exists and I do not know? I have made good use of some of the ones listed. However I still need a Constant for REASON_PROFILE for profile change. Any one with a good clue pls. Thank you in advance.
As a matter of fact, when you change profile, what you get is uninit reason 4 because chart actually closed. Hence, in the absence of any open charts as of the time of the profile change, you get NO uninit reason at all.
It means that the PROFILE_CHANGE uninit can be manually created as follows:
if (no chart is open and no uninit reason occurred OR charts are open AND more than one uninit reason occurred)
profile uninit reason should be assigned the Value 10}
//however if only one chart is open then I have not figured out what to do, because only one uninit reason 4 will be triggered for REASON_CHARTCHANGE
//another thing is how to obtain the profile name for further activities. This one is particularly important because we use profile names such as USD, EUR, CAD, JPY, etc
//to arrange our charts
Your last two questions seems from someone that have known all the trading strategies there could ever be. If you had said that it was not possible as far as you are concerned, I would have appreciated it.
What I would be doing with profile change is that I would name my profiles USD, EUR, GBP, JPY, etc where each chart in a profile is for instrument containing the profile name. Now by the time I change to a profile say GBP, then EA would know that I want to trade the instruments containing GBP (and remember all the charts contain GBP instruments as would have been arranged). So that when a news release favours GBP, and I trade on any chosen chart in the profile (say, I go long GBPUSD) then EA would do the same across board. It would go long GBPUSD and go short EURGBP. You can see that in this case I wont have to manually enter the name of the profile anywhere each time I want to trade, only profile change suffices. You may now tell me how chart open or chart close would do that.
A second, less user friendly and in fact DANGEROUS method is to created a pull
down menu (or list) for one of the input variables in the properties box
of my EA. This input variable contains a list of the currencies (USD, EUR, GBP, JPY, etc) to be entered only by click and select method. The idea is to select from the list (say GBP) and having clicked OK, the EA will take note of the currency GBP for trading the GBP if there is a GBP news available. This method is however less user friendly and would involves changing profile and entering input. Worse still when you have to type the input (profile name of course). Much worse still when you forget to enter the profile name (GBP in this case).