ERR_CUSTOM_INDICATOR_ERROR | 4055 | Custom indicator error. |
Try this:
int error = GetLastError();
if(err != 0) Alert("There was an error BEFORE the OrderSend, error # = ", error);
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
if (ticket<0)
{
Alert ("OrderSend failed with error #", GetLastError());
return (0);
}
int error = GetLastError();
if(error != 0) Alert("There was an error BEFORE the OrderSend, error # = ", error);
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
if (ticket<0)
{
Alert ("OrderSend failed with error #", GetLastError());
return (0);
}
but before OrderSend I didn't get any error alert, I got "OrderSend failed with error #4055"
Is it allowed to do OrderSend function on Demo Account ?
thank you
Tom
Some dealers do not permit automated trading.
Who are you using?
What do you get for IsTradeAllowed() ?
Is this an Indicator or Expert? You can't trade in an indicator
Some dealers do not permit automated trading.
Who are you using?
What do you get for IsTradeAllowed() ?
Is this an Indicator or Expert? You can't trade in an indicator
This is an indicator ichimoku.mq4, so I can't make an orders inside the indicator?
I am a programmer, so programming is not an issue for me, it's just where can I do orders? where can I use OrderSend function?
Thank you very much
Start here
void start()
{
datetime TMY;
string mydate;
double blue=iIchimoku(NULL, 0, 9, 26, 52, MODE_KIJUNSEN, 0);
double blue_last=iIchimoku(NULL, 0, 9, 26, 52, MODE_KIJUNSEN, 1);
double red=iIchimoku(NULL, 0, 9, 26, 52, MODE_TENKANSEN, 0);
double red_last=iIchimoku(NULL, 0, 9, 26, 52, MODE_TENKANSEN, 1);
TMY = iTime(Symbol(),PERIOD_H1,0);
mydate =TimeToStr(TMY,TIME_DATE|TIME_SECONDS);
if (((red<blue) && (red_last<blue_last) && (blue-red)>=0.0004) ){
ObjectCreate("OH"+Open[0], OBJ_VLINE, 0, TMY, Open[0]);
}
if (((red>blue) && (red_last>blue_last) && (red-blue)>=0.0004) ){
ObjectCreate("OH"+Open[0], OBJ_ARROW, 0, TMY, Open[0]);
}
red_last = red;
blue_last = blue;
}
if (((red<blue) && (blue-red)>=0.0003) || (red==blue)){
ObjectCreate("OH"+Open[0], OBJ_VLINE, 0, TMY, Open[0]);
}
Restated:
if( red <= (blue+0.0003) ) draw a line
There is no logic here to detect cross, only "red is less than blue so draw another line"
try
if( (red <= (blue+0.0003)) && (red_last > (blue_last+0.0003)) ) draw a line
That should get you closer to what you want.
if ( (red-blue>-0.000000000000000001) && (red-blue<0.000000000000000001) && (red_last > blue_last) ){
state = 2; //touch from bottom
ObjectCreate("OH"+Open[0], OBJ_VLINE, 0, TMY, Open[0]);
}
if ( (blue-red>-0.000000000000000001) && (red-blue<0.000000000000000001) && (red_last > blue_last) ){
state = 4; //touch from top
ObjectCreate("OH"+Open[0], OBJ_VLINE, 0, TMY, Open[0]);
}
if ( (red-blue>0.000000000000000001) && (red_last < blue_last) ){
state = 1; //cross from bottom
ObjectCreate("OH"+Open[0], OBJ_VLINE, 0, TMY, Open[0]);
}
if ( (blue-red>0.000000000000000001) && (red_last > blue_last) ){
state = 3; //cross from top
ObjectCreate("OH"+Open[0], OBJ_VLINE, 0, TMY, Open[0]);
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I took this example:
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
if (ticket<0)
{
Alert ("OrderSend failed with error #", GetLastError());
return (0);
}
However I am getting an error #4055, what does it mean? I have demo account with Meta Trader. Can't I use and test this command with demo account?
Thank you very much, I searched all over google, but couldn't find any good information about it
Tom