Abdulisback Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion The easiest way to change Master (and Slave brokers for that matter) that I have found is to simply add their xxxxxx.srv files to the config folder to your existing set-up. Then you just log in as usual, open a new account then select the broker that you want to use. I have a list of quite a few but don't know how to post a zip file here. You can PM me with your email and I'll send it. Hello hitescape Could you please provide more explanation on this point? Best regards Quote Link to comment Share on other sites More sharing options...
johan1713006055 Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion Changing the time frame has no effect on the EAs. You get the same results on the M1 or W1, a tick is a tick. On the Master side, it writes out every tick. On the Slave side, the idea is that it reacts much slower than the Master so if you wait for a Slave tick, you miss the Master price action. Therefore, the Slave runs inside of a "while (true)" type of loop. This way, you can be constantly checking the output of the Master file regardless of the number of Ticks. Here you are using the CPU as the timer and maybe a sleep(1) to keep from consuming all of the CPU so the time frame is irrelevant. To give you an idea of what I'm talking about, on average Alpari UK has about 5.5 times as many ticks as FXOpen for any of the major 4 pairs. So if you wait for a FXOpen tick, you have missed 4 Alpari price feed ticks. I also found that by using kernel32.dll calls I can transfer the data more securly and faster than using the MQ4 code. Also, I can put my output file anywhere I like instead of the convoluted directory structure that this EA uses. Hi hitescape, I found out what forum it is where this issue in beeing discussed ;) I understand the logic, that is for me obvious... what I wanted to say is this: what should be changed in the eas settings to be compatible say with FxPro? Maybe try to experiment with the adicional stops? I think there is some room to make some changes so there could be reached some compatility with a bucked shop like FxPro... by the way I am with fxcm and with ibfx but both are in no way candidates for genius... now I opened an account with fxpro and have some experiment in mind... will tell you if it worked out... kind regards, joh Quote Link to comment Share on other sites More sharing options...
⭐ deadsoul Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion guys this is from the other of this EA i hope it can help..some kudos if you find it useful Latency to popular brokers from our Trader's Desktop - a VPS for traders SolutionThe following table list the latency between our Trader's desktop and popular brokers by CNS datacenter [read more about low latency]. There is also more information listed in the FAQ below this chart. Click on the datacenter (i.e. SDCA, NYC or UK) at the top to order a vps in that data center. You can also run your own latency tests from our datacenters through our Looking Glass. SDCA NYC UK ActivTrades [213.203.213.54] 180ms 86ms 12ms Admiral Markets [71.5.110.101] 76ms 36ms 101ms Alpari-RU [212.65.93.13] 197ms 135ms 60ms Alpari-UK [89.238.157.28] 156ms 79ms <1ms Alpari-US [208.122.44.105] 92ms <2ms 88ms ATC [207.99.123.165] 88ms <1ms 74ms CMS FOREX [208.86.26.139] 73ms 14ms 76ms http://www.collective2.com [74.220.20.155] 95ms 8ms 75ms The Collective FX [216.93.250.133] 80ms 6ms 84ms Currenex [64.210.171.58] 72ms 1ms 80ms Dukascopy [194.8.15.159] 163ms 103ms 31ms E-Global [212.158.161.8] 192ms 146ms 57ms FastBrokersFX [129.250.192.74] 80ms 6ms 82ms Forex.com [74.217.53.11] 79ms 1ms 76ms FOREX.com UK [65.51.38.54] (server is in USA) 82ms <5ms 76ms Forex Ltd. [65.175.79.18] 57ms 6ms 110ms ForexMeta SEE FXDD Forex Metal [202.157.171.220] 203ms 286ms 266ms FXCast [212.12.60.156] 168ms 89ms 20ms FXcbs [78.47.113.35] 182ms 107ms 20ms FXCH [207.228.252.28] 94ms 5ms 96ms FX Clearing [208.116.40.196] 70ms <2ms 88ms FXCM [204.8.241.81] 68ms <1ms 76ms FXCM UK [208.118.225.148] (server is in USA) 82ms <6ms 76ms FXDD [129.250.192.70] 88ms 1ms 80ms FXOpen [74.86.131.114] 34ms 38ms 110ms FXPro [real.fxpro.com] 137ms 72ms 1ms FX Solutions Australia [206.18.161.49] (server is in/near NYC) 84ms <6ms 72ms Gallant FX [216.93.249.69] 92ms 6ms 76ms GoMarkets [NZ] [123.100.99.130] 131ms 230ms 284ms Interactive Brokers [208.192.181.62] 93ms 16ms 96ms InterbankFX [66.114.118.12] 19ms 61ms 132ms IKO FX [210.193.54.196] 181ms 289ms 189ms IKON Royal [63.211.88.70] 73ms 3ms InstaForex.com [75.126.23.50] 40ms 36ms 120ms ITradeFX SEE FXCM InvestTechFX [69.59.153.177] 15ms 71ms 152ms JadeFX.com [208.118.226.194] 81ms <5ms 76ms MasterForex [88.85.79.4] 160ms 83ms 8ms MB Trading [216.52.107.78] 8ms 66ms 152ms MigFX [92.42.240.61] 172ms 103ms 33ms OneCorpFX [216.93.255.202] 92ms 6ms PFG Best [24.191.96.245] 104ms 5ms 84ms Prime4X [209.160.22.131] 84ms 7ms 100ms Sig [209.160.40.59] 49ms 84ms 176ms ODL [62.189.82.140] 154ms 77ms 4ms SpotTrader SEE PFG BEST StrategyBuilderFX [66.148.74.123] 84ms 6ms 100ms Tadawulfx [87.119.205.66] 176ms 83ms 12ms TradeView [4.68.99.37] 71ms 1ms Velocity4FX [208.96.31.79] 16ms 73ms 204ms SDCA: San Diego data center NYC: New York City data center UK: London data center Time measured in milliseconds (1/1000th of a second) to brokers gateway. Frequently Asked Questions: Q: How do I use the latency chart? A: You should setup your virtual desktop in the data center with the least latency to your broker. If you are not using the virtual desktop to trade or if your trading strategy is more long term then setup your virtual desktop in the datacenter closer to you for best remote desktop performance. Q: I am trading both west and east coast brokers. Where should I host my desktop? A: Consider setting up two desktops, one for west coast and the other for east coast brokers. You can easily log into both at the same time, and even network them together so you can securely copy files between them. This will give you the best possible latency to all brokers. Please refer to our latency chart to determine the best location to host your trading terminal. Let us know if your broker is not on the list and we will do our best to update it as soon as possible. If you do not want to setup two desktops then pick the broker most important to you and use the data center on the chart with the lowest latency. Q: I already have a virtual desktop. Can I migrate my desktop to the new data center? A: Eventually, all Standard edition desktops will be able to migrate on demand through an icon on the desktop. We understand some subscribers will prefer to keep only one VE and move it to the other data center. We will do our best to accommodate all subscribers as soon as possible, however we expect a line of migrations. We ask that you let us know now if you plan to migrate data centers (reply to this email). Value edition desktops can also be migrated for the first few weeks, but again we ask that you let us know if you plan to migrate so we can plan accordingly. And of course, thank you for your patience while we work to take care of everyone as soon as possible. Q: I am running a scalping EA. What's the difference in performance? A: Night & day, especially for popular EA's where everyone is trying to make the same order at the same time. Figure the average latency to all NYC brokers is less than 5ms (5/1000th of a second). It is difficult for another trader to place an order in front of you when you receive the same price quote so much sooner than they do. Q: How can I figure out the latency I am getting to my broker right now? A: This can be done from inside the VPS (or from your PC if you want to measure latency from your PC). Click start->run Type "cmd" in the box and click ok. This will open a command prompt. Lookup the broker's IP address in the latency chart. For example, IBFX is 66.114.118.12. Type: ping 66.114.118.12 example: C:\Documents and Settings\Administrator>ping 66.114.118.12 Pinging 66.114.118.12 with 32 bytes of data: Reply from 66.114.118.12: bytes=32 time=19ms TTL=238 Reply from 66.114.118.12: bytes=32 time=19ms TTL=238 Reply from 66.114.118.12: bytes=32 time=19ms TTL=238 Reply from 66.114.118.12: bytes=32 time=19ms TTL=238 Ping statistics for 66.114.118.12: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 19ms, Maximum = 19ms, Average = 19ms <-----This is the line to look at The last line shows the minimum, maximum and average ICMP time to the broker, measured in milliseconds (1/1000th of a second). Generally, anything under 150ms is considered good so long as the quality of the circuit is also good (no packet loss). Any number less 20ms is excellent. Consider this: 5ms latency compared to 100ms means the 5ms trader will receive the same price quote and have an order back ~20X sooner. Quote Link to comment Share on other sites More sharing options...
futron Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion Hi guys, Ok here is the findings I came up with so far. FX-Pro as Slave and any other STP ie. JadeFX/The Collective/Go.Markets as Masters gives ok results if slave Safety Marging is set to between 7 and 10 (5 digit brokers) Using a DD broker as slave and any STP as Master but you will have to fine tune "Safety Margin" for this, the 5 digit STP feeds jump around everywhere during trading and it could jump down 5 pips and back up with as much as 10 sometimes which totally confuses this EA as it will close trades in loss faster than it opens them. i am currently working on this aswell as it closes trades much too soon foor my liking the internal SL and TP is much too close so I am reprogramming it to give us better controll of this. Other option I have been thinking of is getting a currenex real time data feed or faster if anybody knows one into either Tradestation or MT4 or if someone could convert the Master.MQ4/ex4 to a Jforex file which can then be used on on a Java platform broker to feed the slave from there. I have already programmed a Master for tradestation but up to now have not been able to find a feed (free) that is in any way faster than the current STP brokers (Jade/collective/fxcm/go markets) also having problems with my set up to get 5 digit feeds from the data feed providers I am able to use into TS. It works well though except current feed speeds is no good. Will be glad if anybody in here has any new ideas I have been struggling with it for a while and if I do find something I will let you all know. Quote Link to comment Share on other sites More sharing options...
Abdulisback Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion The easiest way to change Master (and Slave brokers for that matter) that I have found is to simply add their xxxxxx.srv files to the config folder to your existing set-up. Then you just log in as usual, open a new account then select the broker that you want to use. I have a list of quite a few but don't know how to post a zip file here. You can PM me with your email and I'll send it. Could anybody please explain what dave has suggested? What is the broker xxxxx.srv files? how can I get it? and how can I add that to the config folder to existing Set-up? Sorry for the dumb question, Quote Link to comment Share on other sites More sharing options...
futron Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion Could anybody please explain what dave has suggested? What is the broker xxxxx.srv files? how can I get it? and how can I add that to the config folder to existing Set-up? Sorry for the dumb question, Abdul, If you look in your Brokers Metatrader folder there should be a "Config" folder, Should be something like c:\Program Files\Broco Investor\Config In this folder you will find the .srv files All you need to do with this setup is as follows You have the Primary Broker folder which will be the Slave and inside its experts\files folder you should have the Master as explained in the setup document. So all you need to do is copy all these .srv files you have into the "Master's" config folder. Once that is done when you start the "Master" you can "Create a new account" and select from the Dropdown list which Broker to use as Master. Obviuosly only one at a time can be used unless you make two seperate Slaves, Slave1 and slave2 or 3 ....4 etc. which each will have their own masters inside their experts\files. Just remember you can rename the slave folder to nr1,2,3 etc.. but the master inside each much stay just Master. Hope this helps Quote Link to comment Share on other sites More sharing options...
vafa Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion Do you think AVA FX would be a good broker to trade with using this EA? Quote Being enlightened, is not enough... You must apply Link to comment Share on other sites More sharing options...
JoeCocker Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion @futron, how do you measure datafeed speed? thks for clarifying! btw, I am interested in your modifications re stop loss, could also make sense to 'risk' a few seconds delay before closing the position so to enable more brokers and avoid being seen by them? I am not good in jforex but have a dukascopy account with which I could try to measure datafeed speed once I understand how you actually measure it! cheers, Joe Quote Link to comment Share on other sites More sharing options...
futron Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion @futron, how do you measure datafeed speed? thks for clarifying! btw, I am interested in your modifications re stop loss, could also make sense to 'risk' a few seconds delay before closing the position so to enable more brokers and avoid being seen by them? I am not good in jforex but have a dukascopy account with which I could try to measure datafeed speed once I understand how you actually measure it! cheers, Joe Joe, Not really a way to "measure" as much as watching. What I basically do is have a STP broker's MT4 platform open on demo and other brokers I then put the two MT4 platforms next to each other and watch the prices to see which one reaches a price faster that one (faster) would for all intense and purposes be the "Master" which can be used against "slower" feed brokers. If you look at FX-Pro their price usually LAG's about 0.00005 up to sometimes 0.00012 behind other STP brokers. Once I have the modifications in place I will place the update here. Also changed a few things so you won't have use master and slave. All you need do is copy the "slave" broker's folder into your current or preffered brokers expert/files and the in the slaves inputs tab you just put the "path" to the master like Jadefx/experts/files. I think the delay is a good idea I will place an option for this in the EA. Quote Link to comment Share on other sites More sharing options...
hitescape Posted October 18, 2009 Report Share Posted October 18, 2009 Re: FX Genuis Robot Discussion Abdulisback, Sorry for the incomplete explanation and for the late reply. My connection has been down. Anyway I see that furton has provided a great explanation. If you still need help, please post again. johan, FXPro and most MM brokers use many of the features of MT4 Server to manipulate the feeds. One of the tricks is to delay the execution, which I believe FXPro does. To get this to work with FXPro or FXOpen, one might need to put in a delay to prevent the order from closing before x seconds have elapsed since it was open. Since that is not a feature included in the EA you would need to add it. futron, We are thinking alike with the mods on the SL and TP. Personally, I would do away with the StopLevel he is using for a stop loss and manage both the SP and TP from inside the EA. Sorry, can't help with Tradestation or Currenex. You can PM me for some other ideas on reducing latency on price feeds and, may ultimately, decide that Jade or The Collective (or both combined) will work. Quote Link to comment Share on other sites More sharing options...
johan1713006055 Posted October 19, 2009 Report Share Posted October 19, 2009 Re: FX Genuis Robot Discussion Abdulisback, Sorry for the incomplete explanation and for the late reply. My connection has been down. Anyway I see that furton has provided a great explanation. If you still need help, please post again. johan, FXPro and most MM brokers use many of the features of MT4 Server to manipulate the feeds. One of the tricks is to delay the execution, which I believe FXPro does. To get this to work with FXPro or FXOpen, one might need to put in a delay to prevent the order from closing before x seconds have elapsed since it was open. Since that is not a feature included in the EA you would need to add it. futron, We are thinking alike with the mods on the SL and TP. Personally, I would do away with the StopLevel he is using for a stop loss and manage both the SP and TP from inside the EA. Sorry, can't help with Tradestation or Currenex. You can PM me for some other ideas on reducing latency on price feeds and, may ultimately, decide that Jade or The Collective (or both combined) will work. Hi Hitescape, well, you know, things are more complicated in this matter and most of us are most of the time only guessing ;) let me say a few things whereby I have no intention to discuss these matters in an excessive way... 1) you are right if you say that "most brokers use many of the features of MT4 Server to manipulate the feeds. One of the tricks is to delay the execution, which I believe FXPro does..." But here it comes: all brokers, also the ECN brokers, change to some degree the speed of the data feed. By the way, every MT4 client is beeing monitored from the server site... I have seen the futures that the broker on the mt4 server side can change... one can say that every mt4 client can have a specific set up, and of course data feed plays a great role. But guess what? Most brokers try in the name of their clients to smooth the data feed and this change slows the PA coming in. Here there is a lot to say but I will end with this statement only 2) now here comes a most important future of the "wild forex land" that has also to do with data feed... I will give you some examples: Local connection to the server (I live in Germany) FxPro / on demo = 106 ms / real = 67 ms FxPro from my VPS in Canada demo = 160 ms / real = 99 ms now take The Collective Local connection to the server from Germany demo = 135 ms / real = 145 ms (sic!) From VPS, Canada demo = 21 ms / real = 13 ms Can you see what I mean? There are no general data feed numbers, you must try to find out from your local position what the numbers are - but also if you have a VPS posibility also find out what your ms are, on demo and real... 3) say you find a VPS in New York near your broker, this could mean that the data speed would be very fast, maybe 10 ms or 5 ms... These numbers are for real... 4) What does it mean for us? Well, we can hardly transfer our experiences from a demo account to a real account, because most brokers have different speeds for these acc... not all brokers, but most of them... this means that if we want to success with our Genius Robot we must "jump" into a life account and see if it works... This is of course risky but it is the only way to find out if it works... 5) I know most of us experienced and unexperienced traders think of brokers in terms of a conspiracy theory: they just want to make money and they do everything to reach that goal... I don't think this way and I also don't want to discuss this topic, but want to say this: the problem with a programm that opens and closes too fast is that this trades interfere in a very negative way with most of the other traders... when this happens it causes problems inside the server... To my knowledge this is one of the reasons why the spann of open/close should not go under a specific norm... The solution: if we manage to be in compliance with the specific server of the broker it could word.... Also here is a lot that could be ad, but I will end here... Have good traders and of course a good day, kind regards, joh PS.:Forgot to ask you: any thoughts how to overcome these impases? We need to go in complience with the broker to be successful and accept some facts... hope this is clear enought... Quote Link to comment Share on other sites More sharing options...
hitescape Posted October 19, 2009 Report Share Posted October 19, 2009 Re: FX Genuis Robot Discussion johan, You are 100% correct about the latency issue and accuracy of ANY demo account. I use a VPS from JadeFX that is hosted on their Boston Technologies (BT) server network. This has 1ms latency to both Jade and The Collective because those two brokers and others rent their MT4 servers from Boston Technologies. From my SWVPS VPS my latency is 8 - 12 ms to Jade and The Collective so all quotes that I receive from my SWVPS VPS are already stale and worthless for live trading. This Jade VPS setup is great for getting the Master feeds but the latency to the Slave broker is much larger and I can't find out by how what it is. BT has decided to block ICMP packets (ping) from their VPSs so it is impossible to tell how long it takes for the order to arrive at FXPro etc. My live results for last night using Master feeds from live accounts at The Collective and Jade FX trading on a live Slave account trading 0.10 lots with a SafetyMargin of 8 at FXPro resulted in 28 requotes and one filled order that lost 0.8 pips. If I were to continue, FXPro most likely will freeze or close my account like several other brokers have already done. I, for one, am done with GENIUS as I hate the hassle of opening an account and the bigger hassle of trying to get my money out after a broker has decided to freeze or close my account. My interest now is with a form of broker Arbitrage, taking a position on one broker and an offsetting position on a different broker and closing both when the price disparity reaches 0. This has its own set of risks but hopefully they will be more manageable and still play by the rules of the brokers. I am all for sharing information but with the GENIUS EA I think that if you find a broker where it works, take them for all you can and get your money out as fast as you can. It is like finding a broken or rigged slot machine in Las Vegas. You should either report it and walk away or take every dollar that you can and run like hell! Quote Link to comment Share on other sites More sharing options...
wafiyraziq Posted October 20, 2009 Report Share Posted October 20, 2009 Re: FX Genuis Robot Discussion Some one help me.I already try the FX Genius Robot in 2 day,also done setup for this robot base on instalation given but the robot master or slave not trade once.I realy have some one to help me. Quote Link to comment Share on other sites More sharing options...
Pheniox Posted October 20, 2009 Report Share Posted October 20, 2009 Re: FX Genuis Robot Discussion Our connection time to the broker, any broker is only half the issue here. What this program is trying to do is compare actually the brokers price feed to them, not necessarily us, and the price the broker currently has on the currency. We might have a fast connection to the Master and or Slave but we need to be more concerned with how the broker get his price feed and how fast. Was the complete theory of this program and how fast we can connect means nothing id the broker Master has a faster or slower price feed than the Slave. Feed into the broker first then to us so what makes this almost impossible as I stated from the beginning here after spending 2k on the program was that it was more work that it was worth. Even if we manage to find the proper Master/ Slave combination what happens when the Slave gets a few more dollars to spend themselves and gets a faster price feed for their servers. Oh oh! losses and if we are not watching there goes the profits. So much effort wasted on this " dream" Yes another ISEA. Why such a long thread on a useless program that worls great on a demo account and nothing on a real account. . Quote Link to comment Share on other sites More sharing options...
Damodhar Posted October 20, 2009 Report Share Posted October 20, 2009 Re: FX Genuis Robot Discussion i agree...not worth the countless hours I've spent researching for the right combination and the money. just a nice demo toy.made me 50 000 000 from 1000 in 4 days.....of demo money.....wow man how exciting:) Quote Link to comment Share on other sites More sharing options...
johan1713006055 Posted October 21, 2009 Report Share Posted October 21, 2009 Re: FX Genuis Robot Discussion johan, You are 100% correct about the latency issue and accuracy of ANY demo account. I use a VPS from JadeFX that is hosted on their Boston Technologies (BT) server network. This has 1ms latency to both Jade and The Collective because those two brokers and others rent their MT4 servers from Boston Technologies. From my SWVPS VPS my latency is 8 - 12 ms to Jade and The Collective so all quotes that I receive from my SWVPS VPS are already stale and worthless for live trading. This Jade VPS setup is great for getting the Master feeds but the latency to the Slave broker is much larger and I can't find out by how what it is. BT has decided to block ICMP packets (ping) from their VPSs so it is impossible to tell how long it takes for the order to arrive at FXPro etc. My live results for last night using Master feeds from live accounts at The Collective and Jade FX trading on a live Slave account trading 0.10 lots with a SafetyMargin of 8 at FXPro resulted in 28 requotes and one filled order that lost 0.8 pips. If I were to continue, FXPro most likely will freeze or close my account like several other brokers have already done. I, for one, am done with GENIUS as I hate the hassle of opening an account and the bigger hassle of trying to get my money out after a broker has decided to freeze or close my account. My interest now is with a form of broker Arbitrage, taking a position on one broker and an offsetting position on a different broker and closing both when the price disparity reaches 0. This has its own set of risks but hopefully they will be more manageable and still play by the rules of the brokers. I am all for sharing information but with the GENIUS EA I think that if you find a broker where it works, take them for all you can and get your money out as fast as you can. It is like finding a broken or rigged slot machine in Las Vegas. You should either report it and walk away or take every dollar that you can and run like hell! Hi Hitescape, I agree with you that the risk is too high and the waste of time also an issue for this ea. In this form I give up trying to improve this ea..., have a nice day and kind regards, joh Quote Link to comment Share on other sites More sharing options...
crushbeat Posted October 21, 2009 Report Share Posted October 21, 2009 Re: FX Genuis Robot Discussion yeah.. this ea is useless.. i recommend not to waste ur time with it, unless we find miracles on brokers.. ;) regards Quote Link to comment Share on other sites More sharing options...
dedynof1 Posted October 21, 2009 Report Share Posted October 21, 2009 Re: FX Genuis Robot Discussion FXGenius is great that EA Broker for various rules that we lose, conclusion is no Broker forex has fair Quote Link to comment Share on other sites More sharing options...
futron Posted October 21, 2009 Report Share Posted October 21, 2009 Re: FX Genuis Robot Discussion FXGenius is great that EA Broker for various rules that we lose, conclusion is no Broker forex has fair This is most probably the most honest thing I have heard about forex in my life. I have NEVER NEVER Yes NEVER came across an honest Forex broker in all the years I have been trading. Quote Link to comment Share on other sites More sharing options...
elhombre Posted October 23, 2009 Report Share Posted October 23, 2009 Re: FX Genuis Robot Discussion This is a different Genius ea here, but it has performed very well with one pair with max dd of around 6% and 90% winning trades or better. Can anyone add 'no trade on fridays' to the code? I will be glad to tell which pair, TF, and hours traded. Thanks! //+------------------------------------------------------------------+ //| EA_GENIUS.mq4 | //| //+------------------------------------------------------------------+ #define EA "G" #define VER "1_01" #define OP_CLOSEBY 96 #define OP_MODIFY 97 #define OP_CLOSE 98 #define OP_NONE 99 #define OH1 0 #define CH1 1 #define OH2 2 #define CH2 3 extern string OrderOptions= "-------- Orders options --------"; extern double Lots = 0; extern int LotsPercent = 30; int MaxDrawDown = 30; extern bool UseAutosettings = false; extern int TakeProfit = 30; extern bool TryTakeProfit = false; extern int StopLoss =35; extern bool CheckFreezLevel = true; extern double SafeSpread=3.0; extern int Slippage=3; extern int MagicNumber=1979; int TrailingStop = 50; int MinProfitValue = 5; string TradeOptions= "-------- Trade options --------"; int ChannelBars = 10; int SellCorrection = 0; int BuyCorrection = 0; bool CheckTimeBar = false; bool EqualBars = true; string TransmiteOptions="--------Transmite options--------"; bool TradeTransferIn=false; bool TradeTransferOut=false; bool CheckDeleteFile=false; int TimeOutDeleteFile=10; bool CheckSetOrder=true; int TimeOutSetOrder=10; bool DeleteFileAfterChecking=false; int NumberRepeatCloseOrder = 0; extern string TimeOptions= "-------- Time options --------"; extern bool EachDayHourSettings=false; extern int TradeTimeChoise = 1; extern int TradeDayOfWeek=0; extern int OpenHour1=21; extern int CloseHour1=4; extern int OpenHour2=22; extern int CloseHour2=24; extern int GMToffset=0; string OtherOptions= "-------- Other options --------"; bool ShowComment=false; bool ShowSettings=false; int TimeOutComment=3; bool ShowPrint=false; bool ShowTime=false; bool ShowNameID=false; bool ShowMagicNumber=false; int BarSlippage=2; int BBPeriod=20; int BBShift=0; double BBDeviations=2.5; int BBChannelValue = 50; bool ReversTrades = false; bool LackTrades = false; bool OneTradesToDirection = true; bool HideIndicators = false; // int pipp; double pip; string NameID, InitString; double LotsForTrade; double HighestBarsValue, LowestBarsValue; color ReversOrderColor = Black; color BuyOrderColor = Blue; color SellOrderColor = Red; int LastOrderBar, LastOrderTicket, CurrentOrderTicket, CurrentOrderProfitPoint, CurrentOrderTrailingStop; bool TradeLimit; int opposite_id = 1; double LastOrderTime=0; double CurrentOrderProfit; double BuyOrderPrice; bool GoSell=false, GoBuy=false; double MaxProfit=0, MaxLoss=0; double UPmaxProfit=0, UPmaxLoss=0; double UPminProfit=50, UPminLoss=50; double DOWNmaxProfit=0,DOWNmaxLoss=0; double DOWNminProfit=50, DOWNminLoss=50; int ReadOperationCounter, SaveOperationCounter; int CurrentDirection=OP_NONE, LastDirection=OP_NONE, CurrentMode=1,FileCounterMaxValue=10, CounterRepeatClose; int RB_Counter=0, RB_TimeBar=0, RB_Operation=1, RB_Ticket=2, RB_Price=3, RB_StopLoss=4, RB_TakeProfit=5; int CB_Counter=0, CB_TimeBar=0, CB_Operation=1, CB_RecTicket=2, CB_OurTicket=3, CB_OpenPrice=4, CB_ClosePrice=5, CB_StopLoss=6, CB_TakeProfit=7; bool fTime=true, StopTradesByMargin, LastisOrderSell, LastisOrderBuy, TryRepeatCloseOrder; int LastOpenHour1, LastCloseHour1, LastOpenHour2, LastCloseHour2; bool RepeatCloseOrder, FirstComment=false; string ErrorArray[4207]; int TradeTimeBuffer[5][4]; double ReceiveBuffer[1][6]; double CommandBuffer[1][8]; string CommentBuffer[20][2]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { Comment(""); InitString=""; if (Digits%2) pipp=10; else pipp=1; pip=pipp*Point; Slippage*=pipp; NameID=EA; InitErrorArray(); OpenHour1=(OpenHour1+GMToffset)%24; CloseHour1=(CloseHour1+GMToffset+23)%24+1; OpenHour2=(OpenHour2+GMToffset)%24; CloseHour2=(CloseHour2+GMToffset+23)%24+1; if (HideIndicators) HideTestIndicators(true); LastOrderTime=Time[0]; ClearBuffer("ReceiveBuffer",RB_Counter); ClearBuffer("CommandBuffer",CB_Counter); ClearBuffer("CommentBuffer",0); InitString="Manual settings for "+AccountCompany()+" M"+Period()+"\n"; if (UseAutosettings) { if (SetAutoSettings()) { InitString="Automatic settings for "+AccountCompany()+" M"+Period()+"\n"; } } LastOpenHour1=OpenHour1; LastCloseHour1=CloseHour1; LastOpenHour2=OpenHour2; LastCloseHour2=CloseHour2; StartRulls(); if (Lots!=0) { InitString = InitString + "Lots = " + DoubleToStr(Lots,2) + "\n"; } else { InitString = InitString + "LotsPercent = " + LotsPercent + " %" + "\n"; } // InitString = InitString + "Trade with the top 50 traders in the world today for free. Visit http://worldbest50.zulutrade.com\n"; // InitString = InitString + "Get up to 40% of your spread costs back through our unbeatable rebates, and earn up to 0.7 pips back for every lot you trade. email [email protected] to join\n"; // InitString = InitString + "This robot can double your money every 60 days. Get the current best settings at [email protected] for free\n"; if (TradeTransferOut) { SaveFileOrder(0, OP_NONE, 0, 0, 0, 0, 0); } else { Comments("Initial"); } return(0);} // wrapper. //+------------------------------------------------------------------+ int deinit() { ClearBuffer("ReceiveBuffer",RB_Counter); ClearBuffer("CommandBuffer",CB_Counter); ClearBuffer("CommentBuffer",0); Comment(""); return(0);} // main processor. //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { // if (!StartRulls()) return(0); if (TradeTransferIn) { if (ReadFileOrder()) CheckReceiveBuffer(); CheckCommandBuffer(); return(0); } // PrepareIndicators(); // if (StopByMaxDrawDown()) return(0); // Comments("Start()"); if (isOrderSell() && !TimeCurrentBar()) { if (isGroDtoBuy() || isMinProfittoClose() || TryToCloseAgain()) { if (CurrentOrderProfitPoint<0 && TryTakeProfit) return(0); CloseSellOrder(); return(0); } return(0); } if (isOrderBuy() && !TimeCurrentBar()) { if (isGroDtoSell() || isMinProfittoClose() || TryToCloseAgain()) { if (CurrentOrderProfitPoint<0 && TryTakeProfit) return(0); CloseBuyOrder(); return(0); } return(0); } if (isGroDtoSell(true) && !TimeCurrentBar() && (isTimetoTrade(OpenHour1, CloseHour1) || isTimetoTrade(OpenHour2, CloseHour2))) { { SendSellOrder(StopLoss,TakeProfit); return(0); } } if (isGroDtoBuy(true) && !TimeCurrentBar() && (isTimetoTrade(OpenHour1, CloseHour1) || isTimetoTrade(OpenHour2, CloseHour2))) { { SendBuyOrder(StopLoss,TakeProfit); return(0); } } return(0);} bool StopByMaxDrawDown(){ bool result=false; double CurrentMaxDrawDown; if (MaxDrawDown==0 || (OpenHour1==0 && CloseHour1==12 && OpenHour2==12 && CloseHour2==24)) return(result); if (!isTimetoTrade(OpenHour1, CloseHour1) && !isTimetoTrade(OpenHour2, CloseHour2)) { Comments("StopByMaxDrawDown(): Trade allow"); StopTradesByMargin=false; GlobalVariableSet("MaxAccountValue",AccountBalance()); result=false; return(result); } if (StopTradesByMargin) { result=true; return(result); } if (GlobalVariableGet("MaxAccountValue")-AccountBalance()<0) GlobalVariableSet("MaxAccountValue",AccountBalance()); CurrentMaxDrawDown=GlobalVariableGet("MaxAccountValue")-GlobalVariableGet("MaxAccountValue")*MaxDrawDown/100; /* Comment( "CurrentMaxDrawDown= ",CurrentMaxDrawDown,"\n", "MaxAccountValue= ",GlobalVariableGet("MaxAccountValue"),"\n", "AccountBalance()= ",AccountBalance(),"\n", "AccountEquity()= ",AccountEquity(),"\n" );*/ if (CurrentMaxDrawDown-AccountEquity()>0) { while (isOrderBuy()) CloseBuyOrder(); while (isOrderSell()) CloseSellOrder(); Comments("StopByMaxDrawDown(): Trade is permitted"); StopTradesByMargin=true; result=true; return(result); } return(result);} void ResultTrades() { if (OrderType()==OP_BUY) { if (UPmaxProfit<MaxProfit) UPmaxProfit=MaxProfit; if (UPmaxLoss<MaxLoss) UPmaxLoss=MaxLoss; } if (OrderType()==OP_SELL) { if (DOWNmaxProfit<MaxProfit) DOWNmaxProfit=MaxProfit; if (DOWNmaxLoss<MaxLoss) DOWNmaxLoss=MaxLoss; } MaxProfit=0; MaxLoss=0; } void CalculateTrades() { if (OrderType()==OP_BUY) { if ((Bid-OrderOpenPrice())>MaxProfit) MaxProfit=Bid-OrderOpenPrice(); if ((OrderOpenPrice()-Bid)>MaxLoss) MaxLoss=OrderOpenPrice()-Bid; } if (OrderType()==OP_SELL) { if ((OrderOpenPrice()-Ask)>MaxProfit) MaxProfit=OrderOpenPrice()-Ask; if ((Ask-OrderOpenPrice())>MaxLoss) MaxLoss=Ask-OrderOpenPrice(); } } bool TimeCurrentBar(){ bool result=false; if (CheckTimeBar && Time[0]==LastOrderTime) result=true; return(result);} bool isOrderSell(){ bool result=false; int cnt=0, ticket, total; total=OrdersTotal(); for (cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol() && OrderType()==OP_SELL) { if (!TradeTransferOut && OrderMagicNumber()!=MagicNumber) continue; result=true; CurrentOrderProfit = OrderProfit(); CurrentOrderProfitPoint = (OrderOpenPrice()-Ask)/pip; break; } } if (LastisOrderSell && !result) { if (OrderStopLoss()!=0 || OrderTakeProfit()!=0) LastOrderTime=Time[0]; } LastisOrderSell=result; return(result);} bool isOrderBuy(){ bool result=false; int cnt=0, ticket, total; total=OrdersTotal(); for (cnt=0;cnt<total;cnt++) { OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol() && OrderType()==OP_BUY) { if (!TradeTransferOut && OrderMagicNumber()!=MagicNumber) continue; result=true; CurrentOrderProfit = OrderProfit(); CurrentOrderProfitPoint = (Bid-OrderOpenPrice())/pip; break; } } if (LastisOrderBuy && !result) { if (OrderStopLoss()!=0 || OrderTakeProfit()!=0) LastOrderTime=Time[0]; } LastisOrderBuy=result; return(result);} bool OrderRevers(){ bool result=false; int cnt=0, ticket, total; total=OrdersTotal(); for (cnt=0;cnt<total;cnt++) { ticket = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); ticket = OrderTicket(); if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && OrderType()<=OP_SELL) { if (OrderCloseBy(OrderTicket(),ticket,ReversOrderColor)) { // Comments("Order reversed : "+OrderOpenPrice()); opposite_id=opposite_id+1; result=true; LastOrderTime=Time[0]; if (TradeTransferOut) SaveFileOrder(Time[0], OP_CLOSEBY, ticket, OrderLots(), Bid, 0, 0); } else { Comments("Error revers order: "+PrintError(GetLastError())); } } } return(result);} bool CloseBuyOrder(){ bool result=false; int cnt=0, ticket, total; total=OrdersTotal(); for (cnt=0;cnt<total;cnt++) { ticket = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol() && OrderType()==OP_BUY) { if (isFreezLevel()) continue; if (!TradeTransferOut && OrderMagicNumber()==MagicNumber) { if (OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,BuyOrderColor)) { // Comments("Buy order closed : "+OrderClosePrice()); result=true; LastOrderTime=Time[0]; LastDirection=OP_BUY; RepeatCloseOrder=false; } else { Comments("Error close Buy order: "+PrintError(GetLastError())); RepeatCloseOrder=true; } } else { if (SaveFileOrder(Time[0], OP_CLOSE, OrderTicket(), OrderLots(), Bid, 0, 0)) { // Comments("Close Buy order transmited"); result=true; LastOrderTime=Time[0]; LastDirection=OP_BUY; RepeatCloseOrder=false; } else { Comments("Error transmite Close Buy order"); RepeatCloseOrder=true; } } } } return(result);} bool CloseSellOrder(){ bool result=false; int cnt=0, ticket, total; total=OrdersTotal(); for (cnt=0;cnt<total;cnt++) { ticket = OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol()==Symbol() && OrderType()==OP_SELL) { if (isFreezLevel()) continue; if (!TradeTransferOut && OrderMagicNumber()==MagicNumber) { if (OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,SellOrderColor)) { // Comments("Sell order closed : "+OrderClosePrice()); result=true; LastOrderTime=Time[0]; LastDirection=OP_SELL; RepeatCloseOrder=false; } else { Comments("Error close Sell order: "+PrintError(GetLastError())); RepeatCloseOrder=true; } } else { if (SaveFileOrder(Time[0], OP_CLOSE, OrderTicket(), OrderLots(), Ask, 0, 0)) { // Comments("Close Sell order transmited"); result=true; LastOrderTime=Time[0]; LastDirection=OP_SELL; RepeatCloseOrder=false; } else { Comments("Error transmite Close Sell order"); RepeatCloseOrder=true; } } } } return(result);} bool TryToCloseAgain(){ bool result=false; if (!RepeatCloseOrder) { CounterRepeatClose=NumberRepeatCloseOrder; } else { CounterRepeatClose=CounterRepeatClose-1; if (CounterRepeatClose>0) { result=true; } else { RepeatCloseOrder=false; // Comments("TryToCloseAgain(): Error after repeat Close order"); } } return(result);} bool isFreezLevel() { bool result=false; double Price, FreezLevelValue, CurrentSlippage; if (CheckFreezLevel) { if (OrderStopLoss()!=0 || OrderTakeProfit()!=0) { if (OrderType()==OP_BUY) Price=Bid; if (OrderType()==OP_SELL) Price=Ask; FreezLevelValue=MarketInfo(Symbol(),MODE_FREEZELEVEL)*Point; if ( OrderStopLoss()!=0 && FreezLevelValue>(MathAbs(Price-OrderStopLoss() ))) result=true; if (OrderTakeProfit()!=0 && FreezLevelValue>(MathAbs(Price-OrderTakeProfit()))) result=true; } } return(result);} bool SendBuyOrder(double SBO_StopLoss, double SBO_TakeProfit) { int ticket=0; RepeatCloseOrder=false; if (SBO_StopLoss!=0) { if (SBO_StopLoss < MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp) SBO_StopLoss = MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp; SBO_StopLoss = NormalizeDouble(Bid - SBO_StopLoss*pip,Digits); } if (SBO_TakeProfit!=0) { if (SBO_TakeProfit < MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp) SBO_TakeProfit = MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp; SBO_TakeProfit = NormalizeDouble(Ask + SBO_TakeProfit*pip,Digits); } if (!TradeTransferOut) { ticket=OrderSend(Symbol(),OP_BUY,LotsForTrade,Ask,Slippage,0,0, NameID,MagicNumber,0,BuyOrderColor); OrderModify(ticket, OrderOpenPrice(), SBO_StopLoss, SBO_TakeProfit, 0, CLR_NONE); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { // Comments("Buy order opened : "+OrderOpenPrice()); LastOrderTime=Time[0]; LastOrderBar=Bars; CurrentOrderTicket=ticket; CurrentOrderTrailingStop=0; } } else { Comments("Error open Buy order : "+PrintError(GetLastError())); return(false); } } else { if (SaveFileOrder(Time[0], OP_BUY, ticket, LotsForTrade, Ask, SBO_StopLoss, SBO_TakeProfit)) { // Comments("Buy order open transmited "); LastOrderTime=Time[0]; LastOrderBar=Bars; CurrentOrderTrailingStop=0; } else { Comments("Error transmite open Buy order"); return(false); } } return(true);} bool SendSellOrder(double SSO_StopLoss, double SSO_TakeProfit) { int ticket=0; RepeatCloseOrder=false; if (SSO_StopLoss!=0) { if (SSO_StopLoss < MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp) SSO_StopLoss = MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp; SSO_StopLoss = NormalizeDouble(Ask + SSO_StopLoss*pip,Digits); } if (SSO_TakeProfit!=0) { if (SSO_TakeProfit < MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp) SSO_TakeProfit = MarketInfo(Symbol(),MODE_STOPLEVEL)/pipp; SSO_TakeProfit = NormalizeDouble(Bid - SSO_TakeProfit*pip,Digits); } if (!TradeTransferOut) { ticket=OrderSend(Symbol(),OP_SELL,LotsForTrade,Bid,Slippage,0,0, NameID,MagicNumber,0,SellOrderColor); OrderModify(ticket, OrderOpenPrice(), SSO_StopLoss, SSO_TakeProfit, 0, CLR_NONE); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) { // Comments("Sell order opened : "+OrderOpenPrice()); LastOrderTime=Time[0]; LastOrderBar=Bars; CurrentOrderTicket=ticket; CurrentOrderTrailingStop=0; } } else { Comments("Error open Sell order : "+PrintError(GetLastError())); return(false); } } else { if (SaveFileOrder(Time[0], OP_SELL, ticket, LotsForTrade, Bid, SSO_StopLoss, SSO_TakeProfit)) { // Comments("Sell order open transmited: "); LastOrderTime=Time[0]; LastOrderBar=Bars; CurrentOrderTrailingStop=0; } else { Comments("Error transmite open Sell order"); return(false); } } return(true);} bool StartRulls() { double LotsStep, LotsMin, LotsMax; int LotsDigit; if (EachDayHourSettings && DayOfWeek()>0) { OpenHour1 =TradeTimeBuffer[DayOfWeek()-1][OH1]; CloseHour1=TradeTimeBuffer[DayOfWeek()-1][CH1]; OpenHour2 =TradeTimeBuffer[DayOfWeek()-1][OH2]; CloseHour2=TradeTimeBuffer[DayOfWeek()-1][CH2]; } if (!FirstComment) { FirstComment=true; } else { if (LastOpenHour1!=OpenHour1 || LastCloseHour1!=CloseHour1 || LastOpenHour2!=OpenHour2 || LastCloseHour2!=CloseHour2) { LastOpenHour1=OpenHour1; LastCloseHour1=CloseHour1; LastOpenHour2=OpenHour2; LastCloseHour2=CloseHour2; Comments("Another trade time EA"); } } if (IsOptimization()) { if (OpenHour1>12) return(false); if (CloseHour1>12) return(false); if (OpenHour2<12) return(false); if (CloseHour2<12) return(false); if (OpenHour1>CloseHour1 || OpenHour2>CloseHour2) return(false); } if(Bars<100) { Comments("StartRulls() Bars less than 100"); return(false); } if (IsTesting() || IsOptimization()) { TradeTransferIn=false; TradeTransferOut=false; } if (TradeTransferIn && TradeTransferOut) { // Comment ("TradeTransferIn and TradeTransferOut can't operate simultaneously!!!"); return(false); } LotsStep = NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSTEP),2); LotsMin=NormalizeDouble(MarketInfo(Symbol(),MODE_MINLOT),2); LotsMax=NormalizeDouble(MarketInfo(Symbol(), MODE_MAXLOT),2); if (LotsStep==0.01) LotsDigit=2; else LotsDigit=1; // Lot size calculation if (Lots==0) LotsForTrade=NormalizeDouble(AccountFreeMargin()*LotsPercent/100000,LotsDigit); else LotsForTrade=Lots; if (LotsForTrade>LotsMax) LotsForTrade=LotsMax; if (LotsForTrade<LotsMin) LotsForTrade=LotsMin; return(true);} bool isBBtoBuy(){ bool result=false; if ((iBBHigh(0)-iBBLow(0))/pip<=BBChannelValue && Bid<iBBMidle(0)) result=true; return(result);} bool isBBtoSell(){ bool result=false; if ((iBBHigh(0)-iBBLow(0))/pip<=BBChannelValue && Bid>iBBMidle(0)) result=true; return(result);} bool isMinProfittoClose(){ bool result=false; if (CurrentOrderProfitPoint>0 && CurrentOrderProfitPoint>=MinProfitValue && MinProfitValue!=0) { result=true; } return(result);} bool isTrailingStop(){ bool result=false; int OrderTrailingStop; if (CurrentOrderProfitPoint>MinProfitValue) { OrderTrailingStop=MathCeil(CurrentOrderProfitPoint*TrailingStop/100); if (OrderTrailingStop<1) OrderTrailingStop=1; if (CurrentOrderTrailingStop<OrderTrailingStop) CurrentOrderTrailingStop=OrderTrailingStop; } if (CurrentOrderTrailingStop!=0 && CurrentOrderProfitPoint<=CurrentOrderTrailingStop) result=true; return(result);} bool isTradeLimit(){ bool result=false; if (CurrentOrderTicket!=LastOrderTicket) { CurrentOrderTicket=LastOrderTicket; TradeLimit=false; } if (TradeLimit) return(result); if (OrderProfit()>0) return(result); TradeLimit=true; return(result);} bool isGroDtoBuy(bool checkspread=false){ bool result=false; if (checkspread) if (Ask-Bid>SafeSpread*pip) return(false); if (!ReversTrades) { if (Bid < (LowestBarsValue-pip*BuyCorrection) || (EqualBars && Bid <= (LowestBarsValue-pip*BuyCorrection))) result=true; } else { if (Bid > HighestBarsValue || (EqualBars && Bid >= HighestBarsValue)) result=true; } return(result);} bool isGroDtoSell(bool checkspread=false){ bool result=false; if (checkspread) if (Ask-Bid>SafeSpread*pip) return(false); if (!ReversTrades) { if (Bid > (HighestBarsValue+pip*SellCorrection) || (EqualBars && Bid >= (HighestBarsValue+pip*SellCorrection))) result=true; } else { if (Bid < LowestBarsValue || (EqualBars && Bid <= LowestBarsValue)) result=true; } return(result);} bool isTimetoTrade(int OpenHour, int CloseHour) { bool result = false; int CurrentHour=Hour(); if (OpenHour > 23 || OpenHour < 0 ) OpenHour = 0; if (CloseHour > 23 || CloseHour < 0 ) CloseHour = 0; if (OpenHour<CloseHour && (Hour()>=OpenHour && Hour()<CloseHour)) result=true; if (OpenHour>CloseHour && (Hour()>=OpenHour || Hour()<CloseHour)) result=true; if (DayOfWeek()!=TradeDayOfWeek && TradeDayOfWeek!=0) result = false; return(result);} //-------------------------------------------------------------------------- bool SaveFileOrder( int FileOrderTimeBar,int FileOrderOperation, int FileOrderTicket, double FileOrderLots, double FileOrderPrice, double FileOrderStopLoss, double FileOrderTakeProfit) { int handle; bool result = false; string FileName = Symbol() + ".csv" ; handle=FileOpen(FileName,FILE_CSV|FILE_WRITE,';'); if(handle<1) { // Comments("SaveFileOrder(): File "+FileName+" creation error :" + PrintError(GetLastError())); return(result); } FileWrite(handle, // FileOrderTimeBar, FileOrderOperation, FileOrderLots, FileOrderTicket, FileOrderPrice, DoubleToStr(FileOrderStopLoss,Digits), DoubleToStr(FileOrderTakeProfit,Digits)); FileClose(handle); // Comments("SaveFileOrder(): File saved : "+FileName); result=true; if (FileOrderOperation==OP_BUY) Comments("BUY "+FileOrderOperation+" ; "+LotsForTrade+" ; "+FileOrderTicket+" ; "+FileOrderPrice+" ; "+FileOrderStopLoss+" ; "+FileOrderTakeProfit); if (FileOrderOperation==OP_SELL) Comments("SELL "+FileOrderOperation+" ; "+LotsForTrade+" ; "+FileOrderTicket+" ; "+FileOrderPrice+" ; "+FileOrderStopLoss+" ; "+FileOrderTakeProfit); if (FileOrderOperation==OP_CLOSE) Comments("CLOSE "+FileOrderOperation+" ; "+LotsForTrade+" ; "+FileOrderTicket+" ; "+FileOrderPrice+" ; "+FileOrderStopLoss+" ; "+FileOrderTakeProfit); if (FileOrderOperation==OP_NONE) Comments("NONE "+FileOrderOperation+" ; "+LotsForTrade+" ; "+FileOrderTicket+" ; "+FileOrderPrice+" ; "+FileOrderStopLoss+" ; "+FileOrderTakeProfit); SaveOperationCounter =SaveOperationCounter + 1; if (SaveOperationCounter>FileCounterMaxValue) SaveOperationCounter=0; //Check directory for file datetime TimeSaveFile=TimeLocal(); if (CheckDeleteFile) { // Comments("SaveFileOrder(): File deletion pending"); result=false; while (TimeLocal()-TimeSaveFile < TimeOutDeleteFile) { if (!isFile()) { result=true; break; } Sleep(25); } if (!result) { if (DeleteFileAfterChecking) { if (FileErase(FileName)) { Comments("SaveFileOrder(): Deleted expired file."); } else { Comments("SaveFileOrder(): Expired file deletion failed"); } } else { Comments("SaveFileOrder(): File expired"); } } } //Check open/close orders TimeSaveFile=TimeLocal(); if (CheckSetOrder) { result=false; // Comments("SaveFileOrder(): Waiting for operations..."); while (TimeLocal()-TimeSaveFile < TimeOutSetOrder) { if (FileOrderOperation==OP_SELL && isOrderSell()) { result=true; break; } if (FileOrderOperation==OP_BUY && isOrderBuy()) { result=true; break; } if (FileOrderOperation==OP_CLOSE && !isOrderSell() && !isOrderBuy()) { result=true; break; } if (FileOrderOperation==OP_NONE) { result=true; break; } Sleep(25); } if (!result) { if (DeleteFileAfterChecking) { if (FileErase(FileName)) { Comments("SaveFileOrder(): Deleted expired file."); } else { Comments("SaveFileOrder(): Expired file deletion failed"); } } else { Comments("SaveFileOrder(): File expired"); } } } return(result);} //-------------------------------------------------------------------------- bool isFile() { int handle; string FileName; bool result=false; FileName = Symbol() + ".csv"; handle=FileOpen(FileName,FILE_CSV|FILE_READ|FILE_WRITE); if (handle>0 && FileSize(handle)>0) { FileClose(handle); result=true; } return(result);} //-------------------------------------------------------------------------- bool FileErase(string FileName) { int handle; bool result=false; handle=FileOpen(FileName,FILE_CSV|FILE_WRITE); if (handle>0) { // Comments("FileErase(): handle>0"); FileClose(handle); result=true; } return(result);} //-------------------------------------------------------------------------- bool Comments(string CommentString){ bool result=false; int i,j; if (ShowPrint) { string str=""; if (ShowTime) str=str+TimeToStr(TimeCurrent(),TIME_SECONDS)+" : "; if (ShowNameID) str=str+NameID; if (ShowMagicNumber) str=str+"("+MagicNumber+")"; if (ShowNameID || ShowMagicNumber) str=str+": "; Print(str+CommentString); } if (ShowSettings) { if (ShowComment) Comment(InitString+str+CommentString); } else { if (ShowComment) Comment(str+CommentString); } // if (ShowComment) ShowCommentList(false); return(result);} //-------------------------------------------------------------------------- bool ShowCommentList(bool CheckForOld){ bool result=false; int i,j; string str=""; CommentBuffer[19][0]="Hello"; CommentBuffer[19][1]="Hello"; { for (i=0;i<=19;i++) { if (CommentBuffer[1]!="1") { str=str + i+": "+CommentBuffer[0]+"\n"; } else { Comment (str); break; } } } return(result);} //-------------------------------------------------------------------------- bool ReadFileOrder() { int handle, counter; string str; string FileName; bool result=false; if (fTime) { for(counter=0;counter<FileCounterMaxValue+1;counter++) { FileName = Symbol()+ (MagicNumber + Period()) + "_" + counter + ".csv"; handle=FileOpen(FileName,FILE_CSV|FILE_READ); if (!handle<0) { ReadOperationCounter = counter; fTime=false; FileClose(handle); break; } } } if (fTime) return(result); FileName = Symbol()+ (MagicNumber + Period()) + "_" + ReadOperationCounter + ".csv"; handle=FileOpen(FileName,FILE_CSV|FILE_READ); if (handle>0) { str=FileReadString(handle); ReceiveBuffer[RB_Counter][RB_TimeBar] = StrToInteger(str); str=FileReadString(handle); ReceiveBuffer[RB_Counter][RB_Operation] = StrToInteger(str); str=FileReadString(handle); ReceiveBuffer[RB_Counter][RB_Ticket] = StrToInteger(str); str=FileReadString(handle); ReceiveBuffer[RB_Counter][RB_Price] = StrToDouble(str); str=FileReadString(handle); ReceiveBuffer[RB_Counter][RB_StopLoss] = StrToDouble(str); str=FileReadString(handle); ReceiveBuffer[RB_Counter][RB_TakeProfit] = StrToDouble(str); FileClose(handle); FileDelete(FileName); ReadOperationCounter =ReadOperationCounter + 1; if (ReadOperationCounter>FileCounterMaxValue) ReadOperationCounter=0; Comments("ReadFileOrder(): File read "+ FileName); result=true; } return(true);} bool CheckReceiveBuffer(){ bool result=false; if (ReceiveBuffer[RB_Counter][RB_Operation]!=OP_NONE) { if (ReceiveBuffer[RB_Counter][RB_Operation]==OP_CLOSE) { if (CommandBuffer[CB_Counter][CB_OurTicket]!=0 && ReceiveBuffer[RB_Counter][RB_Ticket]==CommandBuffer[CB_Counter][CB_RecTicket]) { CommandBuffer[CB_Counter][CB_Operation]=OP_CLOSE; CommandBuffer[CB_Counter][CB_ClosePrice]=ReceiveBuffer[RB_Counter][RB_Price]; result = true; } } if ((ReceiveBuffer[RB_Counter][RB_Operation]==OP_BUY || ReceiveBuffer[RB_Counter][RB_Operation]==OP_SELL) && CommandBuffer[CB_Counter][CB_Operation]==OP_NONE) { CommandBuffer[CB_Counter][CB_TimeBar] = ReceiveBuffer[RB_Counter][RB_TimeBar]; CommandBuffer[CB_Counter][CB_Operation] = ReceiveBuffer[RB_Counter][RB_Operation]; CommandBuffer[CB_Counter][CB_RecTicket] = ReceiveBuffer[RB_Counter][RB_Ticket]; CommandBuffer[CB_Counter][CB_OpenPrice] = ReceiveBuffer[RB_Counter][RB_Price]; CommandBuffer[CB_Counter][CB_StopLoss] = ReceiveBuffer[RB_Counter][RB_StopLoss]; CommandBuffer[CB_Counter][CB_TakeProfit]= ReceiveBuffer[RB_Counter][RB_TakeProfit]; result = true; } } ClearBuffer("ReceiveBuffer",RB_Counter); return(result);} bool CheckCommandBuffer(){ bool result=false; if (CommandBuffer[CB_Counter][CB_Operation]!=OP_NONE) { if (CommandBuffer[CB_Counter][CB_TimeBar]+BarSlippage*(Period()*60)<=Time[0]) { if (CommandBuffer[CB_Counter][CB_Operation]==OP_BUY && CommandBuffer[CB_Counter][CB_OpenPrice]>=Ask) { if (SendBuyOrder(CommandBuffer[CB_Counter][CB_StopLoss], CommandBuffer[CB_Counter][CB_TakeProfit])) { result=true; } } if (CommandBuffer[CB_Counter][CB_Operation]==OP_SELL && CommandBuffer[CB_Counter][CB_OpenPrice]<=Bid) { if (SendSellOrder(CommandBuffer[CB_Counter][CB_StopLoss], CommandBuffer[CB_Counter][CB_TakeProfit])) { result=true; } } } if (CommandBuffer[CB_Counter][CB_TimeBar]+BarSlippage*(Period()*60)<=Time[0]) { } } return(result);} bool ClearBuffer(string CurrentBuffer, int Row){ int result=false; if (CurrentBuffer=="ReceiveBuffer") { ReceiveBuffer[RB_Counter][RB_TimeBar] = 0; ReceiveBuffer[RB_Counter][RB_Operation] = OP_NONE; ReceiveBuffer[RB_Counter][RB_Ticket] = 0; ReceiveBuffer[RB_Counter][RB_Price] = 0; ReceiveBuffer[RB_Counter][RB_StopLoss] = 0; ReceiveBuffer[RB_Counter][RB_TakeProfit] = 0; } if (CurrentBuffer=="CommandBuffer") { ReceiveBuffer[CB_Counter][CB_TimeBar] = 0; ReceiveBuffer[CB_Counter][CB_Operation] = OP_NONE; ReceiveBuffer[CB_Counter][CB_RecTicket] = 0; ReceiveBuffer[CB_Counter][CB_OurTicket] = 0; ReceiveBuffer[CB_Counter][CB_OpenPrice] = 0; ReceiveBuffer[CB_Counter][CB_ClosePrice] = 0; ReceiveBuffer[CB_Counter][CB_StopLoss] = 0; ReceiveBuffer[CB_Counter][CB_TakeProfit] = 0; } if (CurrentBuffer=="CommentBuffer") { for (int i=0;i<20;i++) { CommentBuffer[0]=""; CommentBuffer[1]=""; } } return(result);} //-------------------------------------------------------------------------- bool CloseOrdersBuyMargin() { int counter; double MinProfit=0; bool result=false; if ((AccountFreeMarginCheck(Symbol(),OP_BUY, 2*Lots)<=0 || AccountFreeMarginCheck(Symbol(),OP_SELL, 2*Lots)<=0) && (AccountBalance()>AccountEquity()) ) { for(counter=0;counter<OrdersTotal();counter++) { OrderSelect(counter, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) { if(OrderProfit()<=MinProfit) {MinProfit=OrderProfit();} } } for(counter=0;counter<OrdersTotal();counter++) { OrderSelect(counter, SELECT_BY_POS, MODE_TRADES); if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) { if( (MinProfit-OrderProfit())==0 && ( ((MathAbs(OrderOpenPrice()-Bid)-TrailingStop*pip)>0 && OrderType()==OP_BUY) || ((MathAbs(Ask-OrderOpenPrice())-TrailingStop*pip)>0 && OrderType()==OP_SELL) ) ) { OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,White); if (OrderType()==OP_BUY) {Comments("Buy Order close by margin, profit= "+ OrderProfit());} if (OrderType()==OP_SELL) {Comments("Sell Order close by margin, profit= "+ OrderProfit());} result=true; break; } } } } return(result);} // string PrintError(int ErrorCode) { return(ErrorArray[ErrorCode]);} void InitErrorArray() { ErrorArray[0] = "No errors"; ErrorArray[1] = "No errors, but no resulting"; ErrorArray[2] = "General fault"; ErrorArray[3] = "Fault parameters"; ErrorArray[4] = "Trade busy"; ErrorArray[5] = "Old version of terminal"; ErrorArray[6] = "Not connect"; ErrorArray[7] = "Rules not good for you"; ErrorArray[8] = "Very many orders"; ErrorArray [9] = "Invalid operation disrupt the server"; ErrorArray [64] = "blocked account"; ErrorArray [65] = "Invalid account number"; ErrorArray [128] = "Expired expectations of the transaction"; ErrorArray [129] = "Invalid price"; ErrorArray [130] = "Wrong foot"; ErrorArray [131] = "Invalid volume"; ErrorArray [132] = "The market is closed"; ErrorArray [133] = "Trade is prohibited"; ErrorArray [134] = "Not enough money for the transaction"; ErrorArray [135] = "Price has changed"; ErrorArray [136] = "No price"; ErrorArray [137] = "Broker busy"; ErrorArray [138] = "New prices"; ErrorArray [139] = "Order has been blocked and processed"; ErrorArray [140] = "Allow only buy"; ErrorArray [141] = "Too many bugs"; ErrorArray [145] = "Modification is prohibited, as the warrant is too close to the market"; ErrorArray [146] = "subsystem busy trade"; ErrorArray [147] = "Using the date of expiry of the warrant is prohibited broker"; ErrorArray [148] = "The number of open orders and deferred reached the limit set by the broker"; ErrorArray [4000] = "No errors"; ErrorArray [4001] = "Invalid Index function"; ErrorArray [4002] = "Index array - out of range"; ErrorArray [4003] = "No memory to stack functions"; ErrorArray [4004] = "stack overflow after recursive call"; ErrorArray [4005] = "At no memory of the stack to pass options"; ErrorArray [4006] = "No memory for a string parameter"; ErrorArray [4007] = "No memory for a temporary line"; ErrorArray [4008] = "Neinitsializirovannaya line"; ErrorArray [4009] = "Neinitsializirovannaya line in the array"; ErrorArray [4010] = "No memory for an array string"; ErrorArray [4011] = "Too long line"; ErrorArray [4012] = "Balance of dividing by zero"; ErrorArray [4013] = "The division by zero"; ErrorArray [4014] = "Unknown command"; ErrorArray [4015] = "Invalid conversion"; ErrorArray [4016] = "Neinitsializirovanny array"; ErrorArray [4017] = "Challenge DLL not allowed "; ErrorArray [4018] = "Can not load library"; ErrorArray [4019] = "Can not call"; ErrorArray [4020] = "Challenge external library functions are not allowed "; ErrorArray [4021] = "Not enough memory to the line, recovery of the function"; ErrorArray [4022] = "system busy"; ErrorArray [4050] = "Wrong number of parameters function"; ErrorArray [4051] = "Invalid value functions"; ErrorArray [4052] = "Internal error string functions"; ErrorArray [4053] = "Error array"; ErrorArray [4054] = "Misuse of solid-taymserii"; ErrorArray [4055] = "user error indicator"; ErrorArray [4056] = "Arrays incompatible"; ErrorArray [4057] = "Error processing globalnyeh variables"; ErrorArray [4058] = "global variable is not detected"; ErrorArray [4059] = "function is not allowed in test mode"; ErrorArray [4060] = "function is not allowed"; ErrorArray [4061] = "Error sending"; ErrorArray [4062] = "expected parameter type string"; ErrorArray [4063] = "expected parameter type integer"; ErrorArray [4064] = "expected parameter type double"; ErrorArray [4065] = "As expected array parameter"; ErrorArray [4066] = "The requested historical data in a state of renewal"; ErrorArray [4067] = "Error executing trading operations"; ErrorArray [4099] = "End file"; ErrorArray [4100] = "error when working with the file"; ErrorArray [4101] = "Invalid file name"; ErrorArray [4102] = "Too many open files"; ErrorArray [4103] = "Can not open file"; ErrorArray [4104] = "Incompatible regime access to the file"; ErrorArray [4105] = "No warrant is not selected"; ErrorArray [4106] = "Unknown symbol"; ErrorArray [4107] = "Invalid setting prices for commercial functions"; ErrorArray [4108] = "Wrong number tiketa"; ErrorArray [4109] = "Trade is not allowed. You need to include the option Allow an adviser to trade in the properties of expert"; ErrorArray [4110] = "Long positions are not allowed. You should check the properties of expert"; ErrorArray [4111] = "Short positions are not allowed. You should check the properties of expert"; ErrorArray [4200] = "Object already exists"; ErrorArray [4201] = "Requested an unknown object property"; ErrorArray [4202] = "The object does not exist"; ErrorArray [4203] = "Unknown type of object"; ErrorArray [4204] = "No, the object name "; ErrorArray [4205] = "Error coordinates object"; ErrorArray [4206] = "said subwindow Not Found"; ErrorArray [4207] = "error when working with the object"; } //Indicator calculation void PrepareIndicators() { /* HighestBarsValue =High[iHighest(NULL, 0, MODE_HIGH, ChannelBars, 1)]+pip; LowestBarsValue =Low [iLowest (NULL, 0, MODE_LOW , ChannelBars, 1)]+pip; if (IsTesting() || IsOptimization() || AccountCompany()!="Private Consulting Corp.")*/ { HighestBarsValue =High[iHighest(NULL, 0, MODE_HIGH, ChannelBars, 1)]; LowestBarsValue =Low [iLowest (NULL, 0, MODE_LOW , ChannelBars, 1)]; } } //Bollinger Bands indicator double iBBLow(int CurrentBar){ double result; result = iCustom(NULL,0,"Bollinger Bands",BBPeriod,BBShift,BBDeviations,2,CurrentBar); return(result);} double iBBHigh(int CurrentBar){ double result; result = iCustom(NULL,0,"Bollinger Bands",BBPeriod,BBShift,BBDeviations,1,CurrentBar); return(result);} double iBBMidle(int CurrentBar){ double result; result = iCustom(NULL,0,"Bollinger Bands",BBPeriod,BBShift,BBDeviations,0,CurrentBar); return(result);} bool SetAutoSettings(){ bool result=false; // Settings for Fibo Group if (AccountCompany()=="FIBO Group, Ltd.") { if (Symbol()=="EURGBP" && Period()==PERIOD_M5) { ChannelBars=24; CheckTimeBar=false; EqualBars=true; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=1; OpenHour2=23; CloseHour2=0;} if (TradeTimeChoise==0) result=true; } if (Symbol()=="EURGBP" && Period()==PERIOD_M15) { ChannelBars=10; CheckTimeBar=false; EqualBars=true; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=1; OpenHour2=22; CloseHour2=0;} { //Trading hours (fixed) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=1 ; TradeTimeBuffer[0][OH2]=22 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=1 ; TradeTimeBuffer[1][OH2]=22 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=1 ; TradeTimeBuffer[2][OH2]=22 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=1 ; TradeTimeBuffer[3][OH2]=22 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=1 ; TradeTimeBuffer[4][OH2]=22 ; TradeTimeBuffer[4][CH2]=24; } if (TradeTimeChoise==1) { //Trading hours (optimal) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=1 ; TradeTimeBuffer[0][OH2]=20 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=2 ; TradeTimeBuffer[1][OH2]=18 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=0 ; TradeTimeBuffer[2][OH2]=21 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=6 ; TradeTimeBuffer[3][OH2]=20 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=3 ; TradeTimeBuffer[4][OH2]=22 ; TradeTimeBuffer[4][CH2]=24; } result=true; } } if (AccountCompany()=="ODL Securities") { if (Symbol()=="EURGBP" && Period()==PERIOD_M5) { ChannelBars=24; CheckTimeBar=false; EqualBars=true; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=5; OpenHour2=22; CloseHour2=0;} result=true; } if (Symbol()=="EURGBP" && Period()==PERIOD_M15) { ChannelBars=9; CheckTimeBar=false; EqualBars=true; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=5; OpenHour2=22; CloseHour2=0;} result=true; } if (Symbol()=="EURCHF" && Period()==PERIOD_M15) { ChannelBars=15; CheckTimeBar=false; EqualBars=true; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=1; OpenHour2=22; CloseHour2=0;} result=true; } } if (AccountCompany()=="Alpari Ltd.") { if (Symbol()=="EURGBP" && Period()==PERIOD_M15) { ChannelBars=18; CheckTimeBar=false; EqualBars=true; // TakeProfit = 20; StopLoss = 30; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=1; OpenHour2=22; CloseHour2=0;} if (TradeTimeChoise==0) { //Trading hours (fixed) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=1 ; TradeTimeBuffer[0][OH2]=22 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=1 ; TradeTimeBuffer[1][OH2]=22 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=1 ; TradeTimeBuffer[2][OH2]=22 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=1 ; TradeTimeBuffer[3][OH2]=22 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=1 ; TradeTimeBuffer[4][OH2]=22 ; TradeTimeBuffer[4][CH2]=24; } if (TradeTimeChoise==1) { //Trading hours (optimal) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=1 ; TradeTimeBuffer[0][OH2]=20 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=2 ; TradeTimeBuffer[1][OH2]=18 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=0 ; TradeTimeBuffer[2][OH2]=21 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=6 ; TradeTimeBuffer[3][OH2]=20 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=3 ; TradeTimeBuffer[4][OH2]=22 ; TradeTimeBuffer[4][CH2]=24; } result=true; } } if (AccountCompany()=="Private Consulting Corp.") { if (Symbol()=="EURCHF" && Period()==PERIOD_M1) { ChannelBars=1; CheckTimeBar=false; EqualBars=false; if (EachDayHourSettings) {OpenHour1=0; CloseHour1=1; OpenHour2=23; CloseHour2=0;} if (TradeTimeChoise==0) { //Trading hours (fixed) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=1 ; TradeTimeBuffer[0][OH2]=23 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=1 ; TradeTimeBuffer[1][OH2]=23 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=1 ; TradeTimeBuffer[2][OH2]=23 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=1 ; TradeTimeBuffer[3][OH2]=23 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=1 ; TradeTimeBuffer[4][OH2]=23 ; TradeTimeBuffer[4][CH2]=24; } if (TradeTimeChoise==1) { //Trading hours (optimal) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=0 ; TradeTimeBuffer[0][OH2]=21 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=1 ; TradeTimeBuffer[1][OH2]=23 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=0 ; TradeTimeBuffer[2][OH2]=23 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=0 ; TradeTimeBuffer[3][OH2]=22 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=6 ; TradeTimeBuffer[4][OH2]=24 ; TradeTimeBuffer[4][CH2]=24; } if (TradeTimeChoise>1) { //Trading hours (most profitable) TradeTimeBuffer[0][OH1]=0 ; TradeTimeBuffer[0][CH1]=1 ; TradeTimeBuffer[0][OH2]=21 ; TradeTimeBuffer[0][CH2]=24; TradeTimeBuffer[1][OH1]=0 ; TradeTimeBuffer[1][CH1]=7 ; TradeTimeBuffer[1][OH2]=23 ; TradeTimeBuffer[1][CH2]=24; TradeTimeBuffer[2][OH1]=0 ; TradeTimeBuffer[2][CH1]=0 ; TradeTimeBuffer[2][OH2]=23 ; TradeTimeBuffer[2][CH2]=24; TradeTimeBuffer[3][OH1]=0 ; TradeTimeBuffer[3][CH1]=7 ; TradeTimeBuffer[3][OH2]=21 ; TradeTimeBuffer[3][CH2]=24; TradeTimeBuffer[4][OH1]=0 ; TradeTimeBuffer[4][CH1]=8 ; TradeTimeBuffer[4][OH2]=24 ; TradeTimeBuffer[4][CH2]=24; } result=true; } } return(result);} . Quote Link to comment Share on other sites More sharing options...
zoop Posted October 23, 2009 Report Share Posted October 23, 2009 Re: FX Genuis Robot Discussion This is a different Genius ea here, but it has performed very well with one pair with max dd of around 6% and 90% winning trades or better. Can anyone add 'no trade on fridays' to the code? I will be glad to tell which pair, TF, and hours traded. Thanks! this one is old news, has been here for a long time http://indo-investasi.com/viewtopic.php?f=6&t=3864&start=0&hilit=genious Quote Link to comment Share on other sites More sharing options...
elhombre Posted October 23, 2009 Report Share Posted October 23, 2009 Re: FX Genuis Robot Discussion Yeah, I know it has been here for a while but has been performing pretty well, so just wondering if someone could program it to not trade on fridays. Thanks. Quote Link to comment Share on other sites More sharing options...
ryujeans Posted October 23, 2009 Report Share Posted October 23, 2009 Re: FX Genuis Robot Discussion Yeah, I know it has been here for a while but has been performing pretty well, so just wondering if someone could program it to not trade on fridays. Thanks. Now, can you tell us which pair, TF, and hours traded, please? Quote Link to comment Share on other sites More sharing options...
scarface Posted October 23, 2009 Report Share Posted October 23, 2009 Re: FX Genuis Robot Discussion i agree...not worth the countless hours I've spent researching for the right combination and the money. just a nice demo toy.made me 50 000 000 from 1000 in 4 days.....of demo money.....wow man how exciting:) Hi Damodhar, Thanks for sharing your experience with us. By the way, what version did you use and what brokers as well, TF, currency pairs?? Please let us know so the benefit is for all. Best wishes, Quote a New Year 2011 has come, and the challenge has just started 8-) Link to comment Share on other sites More sharing options...
Damodhar Posted October 23, 2009 Report Share Posted October 23, 2009 Re: FX Genuis Robot Discussion well...on demo the best brokers I found was atc as master and gcg as slave. eurusd and gbpusd M5(even though tf doesn't matter at all) tremendous results but demo, live on this brokers was doing great for sometime but not as good as demo(of course),then a couple of weeks it was going really bad but now again i see good profits. check it here: http://www.4shared.com/file/142916793/a2cb7052/genius_live_gcg.html http://i33.tinypic.com/dr9v1e.gif i took this statement directly from the sellers live account that I log in. i sent money already to gcg to try it myself.hope it will work fine,this bro doesn't have a good reputation:( about the version i use have no idea.bought it for 180$ on the net.probably one of the earliest Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.