Toffolo,
it HAS StopLoss and TakeProfit parameters there...
in some MetaTrader implementations (like with the interbank FX version of MT) - there is an option to set a trailing stop on an existing order.
However, why not solve your issue with a script or an Expert Advisor? you can get much more sophisticated behavior as well ...
m
it HAS StopLoss and TakeProfit parameters there...
in some MetaTrader implementations (like with the interbank FX version of MT) - there is an option to set a trailing stop on an existing order.
However, why not solve your issue with a script or an Expert Advisor? you can get much more sophisticated behavior as well ...
m
m88: You are missing my point, if you read my post , you will see that i am talking about "News Trading " , specifically. For example, if I already know that I am going to buy the EUR/USD, then I can enter the SL and TP into the parameter boxes that the MT4 has set up, when you click on "New Order".
However, with a news trade, it would be quite nice, and very effective to able to enter the SL's, TP's, and possibly a trailing stop, on both the buy & sell side, so that the trader can just click on either the buy or sell, when he sees what the numbers came out at, and everything is already in place. For news trading, we just dont have the time to enter the SL, TP, or TS after the fact, because the market moves so fast.
If you look at some of the big, non MT brokers, like FXCM, GFT, FX Solutions, Oanda, & Saxo Bank, they all have a set up similar to what I am talking about. Whats the big deal for you(Meta Quotes) to add these small features that I am asking for ??
However, with a news trade, it would be quite nice, and very effective to able to enter the SL's, TP's, and possibly a trailing stop, on both the buy & sell side, so that the trader can just click on either the buy or sell, when he sees what the numbers came out at, and everything is already in place. For news trading, we just dont have the time to enter the SL, TP, or TS after the fact, because the market moves so fast.
If you look at some of the big, non MT brokers, like FXCM, GFT, FX Solutions, Oanda, & Saxo Bank, they all have a set up similar to what I am talking about. Whats the big deal for you(Meta Quotes) to add these small features that I am asking for ??
yes, i DO understand that.
i have written a short example for a BUY script which i believe is what you basically try to achieve.
If yes, enjoy... it's a gift :)
(look at the comments in the code to get your desirable effects)
//+------------------------------------------------------------------+
//| BuyNow.mq4 |
//| ProjectFX |
//| |
//+------------------------------------------------------------------+
#property copyright "mike@ProjectFX"
#property link ""
#include <WinUser32.mqh>
#include <stdlib.mqh>
#include <stderror.mqh>
//remove the line below if you just want to run it without input (you can change the defaults below)
#property show_inputs
extern double xd_vol = 1.0; //volume, in lots
extern int xi_sl = 10; //stoploss, in pips
extern int xi_tp = 20; //takeprofit, in pips
extern string xs_comment = "NEWS"; //the comment that will be attached to the order
extern int xi_magicNum = 88; //the magic number of the order, so it can be differentiated from other orders/groups
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
bool vb_doItAgainSam;
while(TRUE)
{
//
vb_doItAgainSam = FALSE;
//
int vi_ordNum = OrderSend(Symbol(), OP_BUY, xd_vol, Ask, 50, Ask-(xi_sl*Point), Ask+(xi_tp*Point), xs_comment, xi_magicNum);
if(vi_ordNum == -1)
{
if(MessageBox("Would you like to try again?", "Order NOT successful (" + ErrorDescription(GetLastError()) + ")", MB_YESNO) == IDYES)
{
vb_doItAgainSam = TRUE;
}
}
else
{
MessageBox("Order #" + DoubleToStr(vi_ordNum, 0), "Order Successful!", MB_OK);
}
//
if(vb_doItAgainSam == FALSE)
{
break;
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
i have written a short example for a BUY script which i believe is what you basically try to achieve.
If yes, enjoy... it's a gift :)
(look at the comments in the code to get your desirable effects)
//+------------------------------------------------------------------+
//| BuyNow.mq4 |
//| ProjectFX |
//| |
//+------------------------------------------------------------------+
#property copyright "mike@ProjectFX"
#property link ""
#include <WinUser32.mqh>
#include <stdlib.mqh>
#include <stderror.mqh>
//remove the line below if you just want to run it without input (you can change the defaults below)
#property show_inputs
extern double xd_vol = 1.0; //volume, in lots
extern int xi_sl = 10; //stoploss, in pips
extern int xi_tp = 20; //takeprofit, in pips
extern string xs_comment = "NEWS"; //the comment that will be attached to the order
extern int xi_magicNum = 88; //the magic number of the order, so it can be differentiated from other orders/groups
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
bool vb_doItAgainSam;
while(TRUE)
{
//
vb_doItAgainSam = FALSE;
//
int vi_ordNum = OrderSend(Symbol(), OP_BUY, xd_vol, Ask, 50, Ask-(xi_sl*Point), Ask+(xi_tp*Point), xs_comment, xi_magicNum);
if(vi_ordNum == -1)
{
if(MessageBox("Would you like to try again?", "Order NOT successful (" + ErrorDescription(GetLastError()) + ")", MB_YESNO) == IDYES)
{
vb_doItAgainSam = TRUE;
}
}
else
{
MessageBox("Order #" + DoubleToStr(vi_ordNum, 0), "Order Successful!", MB_OK);
}
//
if(vb_doItAgainSam == FALSE)
{
break;
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
M88: Thank you very much, I appreciate this script, and the time you put into coding it. I am not a programer as such, but I dont see anything for a TS, is it possible to add that if thats not to much trouble ??
George
George
Toffolo,
TS would have to be implemented as an Expert Advisor that can pick up an existing order.
It can have different flavours and design of their "logic", both from design consideration (use levels, targets, speed of convergence, simple "neck-tie" locking, etc...) and operational considerations (process every tick, only at bar open, use conditioning, etc...)
From the technical aspect, they can be handled ONLY locally,
meaning that if from some reason your MT terminal goes down, or loses communications, it won't be able to "auto" stop the order. If that's an acceptable risk, life is easier :)
If not (suppose you need to go for toilet while opening a $100k position), then precautive mechanisms should be used, for example, modifying the SL value ON SERVER whenever local SL is changed (due to the TSL mechanism).
This too, can have problems (position modify or close did not succeed because some problem on the server, price fluctuations, etc... etc...) - and therefore needs to be backed-up with a failproof-errorchecking/retry mechanism.
In short, since a TSL is a micro-strategy in a nutshell, besides its logic, its complexity depends on the level of robustness and true self-sufficiency you want to apply.
Since I am not aware of your real life requirements, and coding something good will probably take more than a flash 15 minutes - if you are into it, I can program it for you for a small fee.
Best wishes,
stsf_mike at yahoo dot com
TS would have to be implemented as an Expert Advisor that can pick up an existing order.
It can have different flavours and design of their "logic", both from design consideration (use levels, targets, speed of convergence, simple "neck-tie" locking, etc...) and operational considerations (process every tick, only at bar open, use conditioning, etc...)
From the technical aspect, they can be handled ONLY locally,
meaning that if from some reason your MT terminal goes down, or loses communications, it won't be able to "auto" stop the order. If that's an acceptable risk, life is easier :)
If not (suppose you need to go for toilet while opening a $100k position), then precautive mechanisms should be used, for example, modifying the SL value ON SERVER whenever local SL is changed (due to the TSL mechanism).
This too, can have problems (position modify or close did not succeed because some problem on the server, price fluctuations, etc... etc...) - and therefore needs to be backed-up with a failproof-errorchecking/retry mechanism.
In short, since a TSL is a micro-strategy in a nutshell, besides its logic, its complexity depends on the level of robustness and true self-sufficiency you want to apply.
Since I am not aware of your real life requirements, and coding something good will probably take more than a flash 15 minutes - if you are into it, I can program it for you for a small fee.
Best wishes,
stsf_mike at yahoo dot com
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You see, the set up you have now, is okay for regular trades, but for news trades, its not a very good set up. Most brokers that dont have the MT4 platform, have a set up like I am describing here.
George