| / | Forum |
|
azman818
2006.10.21 02:04
hi, i'm newbie on metatrader and at mql4. can anyone help with a simple script
to close trade at 1 pip. i'll open trade manually but would like to automate
close only. any help much appreciated.
|
|
Forecasting Financial Time-Series Forecasting financial time-series is a required element of any investing activity. The concept of investing itself - put up money now to gain profits in future - is based on the concept of predicting the future. Therefore, forecasting financial time-series underlies the activities of the whole investing industry - all organized exchanges and other securities trading systems. |
|
cubesteak
2006.10.26 11:26
azman818 wrote: hi, i'm newbie on metatrader and at mql4. can anyone help with a simple script to close trade at 1 pip. i'll open trade manually but would like to automate close only. any help much appreciated. Hmm.. Well you have to check to see if the order is a buy or sell. If it is a buy, you need to check of the Ask - OrderOpenPrice = 1, and if so, close it. If it is a sell, you need to see if the OrderOpenPrice - Bid = 1 and if so close it. BUT, I will add that most MT4 based dealers won't like this behavior. I can't think of a one that wouldn't count this as scalping and subsequently demand that you stop doing it. May sound unfair, I know, but think of it like card counting at a casino. There is nothing "ethically" wrong with card counting, but a casino will ban you from playing there if you do it. Most MT4 brokers don't like scalping (for various reasons that can be debated ad infinitum), and they will likely decline to take your trades after a while if you do it regularly. Think of it as the rules of the house that you've chosen to play in. :) This of course is doesn't apply to an order that is open for several minutes/hours/days and is then closed with 1 pip in profit. It only applies to opening an order and closing it "almost" immediately with a small number of pips. If you want further explanation, ask your broker to explain the rules of their trading: How long does a trade have to be open before you can close it without being flagged? If you close an order before that time, how many pips in profit must it be to avoid being flagged? etc. Anyway, good luck. Hope this helps.. -CS |
|
azman818
2006.10.26 19:35
many thanks fot the pointers. i'm an ignorant newbie now. i'll have to learn about
the seriousness of scalping offence and learn about my dealer's trading rules.
could you by any chance write out a simple full script for this purpose and that
i can compensate you or so. thanks.
|
|
jswanson
2006.10.30 17:18
I have a broker with an institutional price feed that i negotiated for personal
use. Perhaps we should talk about this. I'm looking for a good scalper
that grabs one pip per trade. I have 1 pip spreads on EUR and JPY.
Many times the spreads are 0.
|
|
Zap
2006.10.30 18:48
jswanson wrote: Would you write me to forexzap AT gmail DOT com please, I am interested too.I have a broker with an institutional price feed that i negotiated for personal use. Perhaps we should talk about this. I'm looking for a good scalper that grabs one pip per trade. I have 1 pip spreads on EUR and JPY. Many times the spreads are 0. |
|
azman818
2006.10.30 21:32
wonderful, jeff. pls email me - azman818@streamyx.com |
|
asmocon
2006.10.31 00:23
Well, I can give you the way that we do it right now. Basically, it is just a variable
so you can set it from 0-100000 if you wanted to. If you want just one pip, just
put it as 1. (which will be the first pip of profit it would close, while zero
will close right when it breaks even).
extern int TrailingStopShortScalp = 1; //+------------------------------------------------------------------+ if((OrderOpenPrice()-Ask)>(Point*TrailingStopShortScalp)) |
|
azman818
2006.10.31 08:55
wonderful, wonderful. thank you asmocon. this mql is alien to me, but your script
looks neat and straight to the point. you will definitely hear from me when
i start to make some real money.
|
|
richplank
2006.10.31 09:16
Hmm; how does that EA make profit? Won't it just modify an order so that the stoploss
equals open price? Where's the 1-pip profit made?
|
|
asmocon
2006.10.31 11:01
extern int TrailingStopShortScalp = 1;
extern int TrailingStopLongScalp = 1; And then - Point*TrailingStopShortScalp --Basically that part makes it close after 1pip of postive movement. So, if you manually open a trade and say there is a -2 pip spread on the trade. So, you open it and it is opened at 1.8888. Since that is -2 already, when it becomes 1.8891, which is just positive +1 pip profit, it will close. Of the code said: extern int TrailingStopShortScalp = 0; extern int TrailingStopLongScalp = 0; It would close it right when it hit the break-even, which would be 1.8890. Hope that makes sense. If this doesn't work for some reason, let me know. Like if you want to just try it and watch it (manually close it if it doesn't automatically do it). Enjoy. |
|
azman818
2006.11.01 09:47
I don't know if I've done this correctly. I've saved as script and tried to execute
when my one pip is up. The journal recorded "loaded successfully" and
then "removed" the very same instant but trade did not close. I've then
saved as EA and "attach to chart" and journal records successful load
but still NO close. pls tell where I've gone wrong.
|