| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Try looking at a few of the EA's you already have. Study the code and try to see if you can figure out some of the logic. Try speaking the flow of the program out loud. It helps a lot!
![]() Good Luck Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV ![]() ForexArea.com Users of Gap Trader from 'Forex-Assistant' MUST Read This |
|
|||
|
hi all..
thanks luxinterrior for the reply.. Quote:
BUY post when the MACD become 'u' shape.. the condition when.. Code:
if (MacdBuffer7[i+3]>MacdBuffer5[i+2]&&MacdBuffer5[i+2]>MacdBuffer3[i+1]&&MacdBuffer3[i+1]>MacdBuffer1[i]
&&MacdBuffer1[i]<MacdBuffer2[i-1]&&MacdBuffer2[i-1]<MacdBuffer4[i-2]&&MacdBuffer4[i-2]<MacdBuffer6[i-3])
the condition when.. Code:
if(MacdBuffer7[i+3]<MacdBuffer5[i+2]&&MacdBuffer5[i+2]<MacdBuffer3[i+1]&&MacdBuffer3[i+1]<MacdBuffer1[i]
&&MacdBuffer1[i]>MacdBuffer2[i-1]&&MacdBuffer2[i-1]>MacdBuffer4[i-2]&&MacdBuffer4[i-2]>MacdBuffer6[i-3])
|
|
||||
:: if it's suitable then try to form it in a EA, there you can loop & use sleep function, I've tried several simple setups to have only processes/calculations not related to ticks, but then you have the refresh screen issue ... so ... I've changed everything back to normal ... the importance to do so was not that great ... perhaps in MQL5 coming up
__________________
..SUPER REVISED.. IN10TION newsReader v09.8 Lite - the best news reader on your chart
|
|
|||
|
Hi there,
I hope you don't mind me butting in here, I'm looking at a similar situation and I have a thaught on the issue... what about if you code a loop at the end of your program that says "if no order is open run through again". and let it loop maybe 3 or 4 times. If it does that then any missed orders (which happens quite often) should surely get picked up. or is there something wrong with my thinking. I think it would look something like this... Quote:
|
|
||||
:: it will not work with indicators like that, even if you loop 1.000.000 times, it will stall everything else, nothing other then that loop will be processed, when the loop is finished then your terminal will continue her normal processes before a new tick.
__________________
..SUPER REVISED.. IN10TION newsReader v09.8 Lite - the best news reader on your chart
|
|
|||
|
Simple arrow based indicator and EA
Hi, Everyone.
Recently I was trying to make a simple EA that would work on an arrow-based indicator. I am trying to make the EA to maintain one order at any given time. If the arrow points down, the previous buy order is closed and sell order is opened. If the arrow points up, the previous sell order is closed and buy order is opened. I am using the tester (visualization mode) to verify my code. It seems that no matter how I try, the EA does not close and open the positions when arrow indicator points up or down. The back test confirms that the EA is not working properly. Instead of opening and closing the orders at the arrow points shown by the indicator, the EA closes/opens order at some different time. I cannot understand why my code doesn't work. In the beginning of start statement, I have the following code: if (Time[0] == savedTime) { return (0); } else { savedTime = Time [0]; } This (I hope) will ensure that the code in the start statement is executed only when new bar has formed. Later in the body of the start subroutine, I query the indicator with iCustom function. The request looks as below: iCustom (... 1) The last argument of one specifies the previous formed bar, which is why it is not 0. Yet later I close the opened order with OrderClose and open new one with OrderSend. I suppose that both functions must be able to execute instantaneously. The bottom line is: I am trying to create an EA based on arrow indicator. The indicator points either up or down. The way I see it (and I am probably incorrect), the only thing that I need to do is to close previous order and open new one when the next bar has formed. I would greatly appreciate any input into this problem. Thanks to all. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |