Help with coding
|
|||
|
Hi there,
I need to make a change on a simple expert advisor that is based on 2 slope direction lines. This lines, changes to blue when on uptrend and red when on downtrend. The expert advisor gets a global variable=1 when both uptrend (2 slope=blue) and a global variable=2 when both on downtrend (2 slope=red). When global variable=1 the ea opens a position BUY, when global variable=2, the ea opens a position SELL. The problem is that when the profit is reached, it closes the position but if both signals are still there, it opens an additional position. For instance, I am on a position BUY when both slopes are blue with a profit targer=20. When 20 pips are reached, the position is closed BUT IF BOTH SLOPES ARE STILL BLUE, it opens another position... Can anyone help me with a code that does not open a second position like this? I want to be able to open several positions for the same currency pair, but not when one of them is closes. I need something that creates a second global variable that after a position is closed it adds a value to it that will be also compared when both slopes gets with the same color, and besides the BLUE / RED conditions it also tests this global variable. I have been thinking on the following: - Both slopes becames RED; - EA opens SELL; - Second variable gets the NoOpenCondition=TRUE; - When the position reaches its profit target (or stoploss) it is closed; - The advisor waits for NoOpenCondition = FALSE and from this moment it waits for a new signal for potential positions. This NoOpenCondition can be tested by waiting that at least one of the slopes became on the oposite color and when they get the same color again it is a moment for new positions. Hope you can help me Best regards Paulo |
![]() |
|
|||
|
Quote:
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here Coding services: Experts Advisors, indicators, alerts, etc ... NEW: TripleXXX Expert Advisor developed by Spiritfriends and coded by FerruFx ... more info |
|
|||
|
Quote:
Thank you. I have thought about this solution and works when a specific profit target is reached since I can code this moment. But the problem is when an order is closed on a specific stop loss. I am unable to get a code that gives me the information that the order was closed on stop loss... Regards Paulo |
|
|||
|
Quote:
FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here Coding services: Experts Advisors, indicators, alerts, etc ... NEW: TripleXXX Expert Advisor developed by Spiritfriends and coded by FerruFx ... more info |
|
|||
|
Quote:
For your info, I received a PM on FF with the exact same blabla ... coincidence !!! PS: I don't have nothing against you. You're just little bit paranoid ...
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here Coding services: Experts Advisors, indicators, alerts, etc ... NEW: TripleXXX Expert Advisor developed by Spiritfriends and coded by FerruFx ... more info |
|
||||
|
Quote:
Coincidence? NO. One of my friends PMed you after he saw what you wrote about me. Paranoid? NO. I saw the FALSE ACCUSATIONS you wrote on Forex-TSD. |
|
|||
|
Quote:
And you may confuse with someone else. I don't remember make accusations about you on TSD forum. FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! More info here Coding services: Experts Advisors, indicators, alerts, etc ... NEW: TripleXXX Expert Advisor developed by Spiritfriends and coded by FerruFx ... more info |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help coding a simple EA | sundwnr | System Coding | 1 | 11-22-2007 10:43 PM |
| MQL4 Coding | robertinno | Classified Ads | 0 | 10-01-2007 10:12 PM |
| Coding Help needed | yemupz | Trading Systems | 0 | 09-14-2007 03:30 PM |
| Some coding suggestions | 4xdude | Tutorials, Tips & Tricks | 0 | 08-27-2007 08:17 AM |
| Coding an EA | ossaossa | System Coding | 0 | 04-15-2007 01:25 AM |
All times are GMT. The time now is 05:52 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now








Linear Mode


