| 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 (1) | Thread Tools | Display Modes |
|
|||
|
Hey, I'm still new to programming, and I am having trouble adding the following features to this simple EA:
1. Take Profit 2. Stop Loss 3. Trailing Stop 4. Number of pips to activate trailing stop PHP Code:
|
|
|||
|
How to detect a jump from parabolic sar?
I'm currently using this code for detecting a jump:
if(iSAR(NULL,0,0.02,0.2,0)-iSAR(NULL,0,0.02,0.2,1)>1.0){ // if there is a jump up But this doesn't seem to work right. How can i detect if the psar is above or below my bars? TIA |
|
||||
:: use your proxy in metatrader...
__________________
..4.Nov.08.. IN10TION newsReader v09.85 Lite - the best news reader on your chart
|
|
||||
:: compare your sar result with a current close[0]
__________________
..4.Nov.08.. IN10TION newsReader v09.85 Lite - the best news reader on your chart
|
|
|||
|
Use the OrderHistory() function.
Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV ![]() ForexArea.com Users of Gap Trader from 'Forex-Assistant' MUST Read This |
|
||||
|
Thanks but not sure how that works. I don't really want to know if an order was just closed but rather if an order was just Opened and Closed within so many bars. Then only place another trade on next main signal entry. I'm still trying to eliminate quick trade re-entries when an order was just opened and closed but trade conditions are still met. I want it to somehow only do One trade per main signal, so even though trade conditions are still valid don't trade again if already traded on that signal (including offset).
Let me see if I can explain with an example. It might be something that can't be helped. EG: Let's say I'm using QQE and VQI as a signal trade entry point (QQE cross and VQI changes from buy to Sell or visa-versa) Now I'm adding a SignalOffset option of lets say 6 bars because the QQE cross and VQI signal might not happen exactly on the same bar. Now lets say there is a valid trade within 2 bars of each other when QQE and VQI agree, so now a trade is placed but I have a TP of 10 pips and the bar moves 15 pips my TP is hit and the trade is closed. Trade conditions are still met because of my 6 bar Offset now another trade is placed (re-entry) bad if that one or two bars moves 100 pips and my TP is 10, I've just had 10 trades, bad I only want One trade per Signal (Offset included)Does that make sense? i would still want it to trade within the 6 bars though if and opposite signal happens and the other trade was closed still. Thanks |
|
||||
:: make a [switch] variable, if there is already 1 sell order made it stops doing other sells (switch value is -1) & will only readjust when there is a buy signal & buy order made (switch value is 1)... something extra (surplus) you can think about is a timer reset, in case if there is a big trend up or down, you can have 2 or 3 sells with a kind of interval in between same orders (timing). Quote:
__________________
..4.Nov.08.. IN10TION newsReader v09.85 Lite - the best news reader on your chart
|
![]() |
| Bookmarks |
| Tags |
| candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
|
||||
| Posted By | For | Type | Date | |
| Need an experienced programmer? - Page 2 | Post #0 | Refback | 09-24-2008 07:24 AM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 05:22 PM |