[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 912
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
I'm sorry, I can't deal with my "Expert Advisor", it chronically gives an error 130 wrong stops, and does not trade. I've set different stops, 10-60 pips, all the same.
To begin with, instead of a stop and profit in SendOrders, put 0. Check whether the orders are opened. At first glance, your stops have to be 10 times larger, most likely you have five-digit quotes and the stops are too close to the open price .
I'm sorry, I can't figure it out with my "EA", it chronically gives error 130 wrong stops, and does not trade. I've set all kinds of stops, 10-60 pips, all the same.
I think it should work. as my EA does not work properly at all, my total is always 0, alternating with an error 130.
I set extern double Lots=0.1, TakeProfit=50, stoploss=10;
I dont know what is wrong.
Help!!!!!!!!!!!! Please!!!!!!!!!!!!
I'm ok, maybe five digits? stops*10 and takeloss*10
I'm fine, maybe five digits? Stop*10 and take*10
Well, the problem with the five digits, and with all the signs is easy to solve.
You write it in the Inite:
And, accordingly, initially declare a variable PointX of type double. Then, in the EA code, replace Point with PointX everywherelike this
static int KolBars; // this variable stores the number of bars
if ( your condition && Bars != KolBars)
{ // if the number of bars has changed on the screen - opening of a new candle is the condition for taking action
Actions according to the algorithm are done, closing position opening, calculations etc;
KolBars=Bars ; // record the number of bars at which the actions are completed
}
Now trades are opened every hour (TF H1) with the appearance of a new candle, despite my opening condition.
I also don't know how to replace stop loss with close of a certain candlestick.
"static int KolBars; // this variable stores number of bars" - should I specify number of candlesticks to analyze? static int KolBars=3
I want to build an EA with a condition like "if the previous 3 candlesticks were green, then open a sell trade on a new candlestick, and close it on the close of this candlestick or the next one".
http://forexsystems.ru/sovetniki/26492-poisk-sovetnikov-[kto-ischet-pishem-sdes%60].html
h ttp://www.forexfactory.com/showthread.php?t=168161
thank you very much.
GENETIC ALGORITHM gives different results every time...... WHAT TO DO??? tried normalization. There are no slips. In programming seems to be not the first year......... I DO NOT UNDERSTAND!!! HELP!!!
Imagine having to implement a genlock function yourself, what would it take to do that?!
How many passes would have to be made without a gen. algor. and how many passes would he make with a gen. algor.(please state it for the case in question).
If data without genlock does not match after two optimizations, then pseudo random numbers must have been used somewhere to make a trade condition (tails?).
"No slips" when testing and optimizing slips don't work at all.
It's interesting, I read ivandurak's post and immediately realized that after each tick only the start is triggered, so if you open the variable globally, it seems to save the value.
Стало быть,где-то так.//+------------------------------------------------------------------+
//| Bollocks.mq4 |
//| Copyright © 2010, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
int KolBars=Bars;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{int r;
r=Bars- KolBars
//----
for( r>0 )
int k;
//----
return(0);
}
//+------------------------------------------------------------------+ So, the compiler categorically does not accept the line int KolBars=Bars; it swears 'Bars' - initialization expected C:\Program Files (x86)\Alpari ÌÒ4\experts\Áùå.mq4 (8, 13)
Amazing!!!!! Normal variable declaration. But never mind.
I'll ask the main thing - how to debug an EA at the weekend, if the ticks don't go?????
costy_:
I'm fine, maybe five digits? stops*10 and take*10
Well, the problem with five digits, and with all signs is not difficult to solve.
In the Inite, write:
if(Digits==5 || Digits==3) PointX = Point * 10; // Correct Point for three- and five-digit characters
if(Digits==4 || Digits==2) PointX = Point;
And, correspondingly, initially declare the PointX variable as double. Then, in the EA code everywhere, replace Point with PointX Once again, thank you very much!!! I've been struggling with this for a week myself!!!