|
|||
|
|||||||
| Notices |
| 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 |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|||
|
About take profit & stop loss
I am sorry for my english.
In Coders' Guru - First Expert Advisor - we get "TakeProfit = 250". I thing TakeProfit is the maximum profit that we can take, but when backtest in 4H tf we got profit 980, 855, etc. And when I try to add stop loss "TakeStop = 350" OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+TakeStop *Points,Bid- TakeProfit*Points, "macd sample",16384,0,Red); It still I got stop for -950, -1420, etc. Can anyone explain me why ? |
|
|||
|
Hi all,
I'm sorry. I mean to search but my keyword is too short. I just want to know if there is any way I can get the code for *.ex4 files? (keyword for my search: ex4) I would like to do a simple editing to my preference but I only have the *.ex4 file. Any help? |
|
||||
|
No one interested?
Just in case somebody's listening ...
How about this ? Does it make sense for 5min timscale? Code:
int Minute5; //global to hold 5 minute number
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
void init()
{
Minute5 = TimeMinute(TimeCurrent()) / 5;
}
//+------------------------------------------------------------------+
int start()
{
if (ManageOpenOrders() > 0)
{
return(0);
}
else
{
if ( (TimeMinute(TimeCurrent()) / 5) != Minute5 )
{
Minute5 = TimeMinute(TimeCurrent()) / 5; //reload variable at first tick of every candle
// check trade criterion ...
|
|
|||
|
iStochastic help needed -Slowing field variable issue...
Hi:
I am having problem with iStochastic. It returns ZERO value when the MODE_SIGNAL (value of 1) - is used with SLOWING as a variable. extern int stoch1k = 14 ; extern int stoch1s = 3 ; extern int stoch1d = 3 ; double stoch1s = iStochastic (NULL,0, stoch1k,stoch1d,stoch1s, 0,0,1,0) ; always return a ZERO value and not the real position of signal line when variable is used in SLOWING filed (stoch1s). But when I HARDCODE that parameter, instead of variable stocha1s (Slowing) I put number 3 in the same statement it works fine like below : double stoch1s = iStochastic (NULL,0, stoch1k,stoch1d,3, 0,0,1,0) ; Can anyone guide me on this please. I would like to use variable fields for diff values. Thanks in advance Pipmonger |
|
|||
|
NewBar
Quote:
Code:
int start()
{
if(ISNewBar(5))
{
//do some thing
}
}
bool ISNewBar(int iTimeFrame)
{
int iIndex = -1;
switch(iTimeFrame)
{
case 1 : iIndex = 0; break;
case 5 : iIndex = 1; break;
case 15 : iIndex = 2; break;
case 30 : iIndex = 3; break;
case 60 : iIndex = 4; break;
case 240 : iIndex = 5; break;
case 1440 : iIndex = 6; break;
default : iIndex =-1; break;
}
static int LastBar[7]= {0,0,0,0,0,0,0};
datetime curbar = iTime(Symbol() ,iTimeFrame, 0);
if(LastBar[iIndex]!=curbar)
{
LastBar[iIndex]=curbar;
return (true);
}
else return(false);
}
|
|
|||
|
How to modify alert code so it alerts as it happens
Hi guys,
I'm newbie to coding. I have this OSMA indicator, it already has built in zero cross alert but unfortunately it only alerts at the beginning of next candle. Please show me how to modify the alert code so it will alert as it happens. And please show me how to add arrow alert. Thanks. |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4, ToR 1.20, JMASlope |
| Thread Tools | |
| Display Modes | |
|
|