[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 877
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
Why, the expression A=Close [1] is not valid?????????? The result is always 1 !!!!!!!!!!!!!
Also here is always 1 extern int Bar; B=Close [Bar];
And here it is always 0 C=A-B ; , and here it is always zero int difference=Close [1] - Close [Bars]; People, tell me, I am confused,
Why, the expression A=Close [1] is inappropriate??????????
Why, the expression A=Close [1] is not valid?????????? The result is always 1 !!!!!!!!!!!!!
Also here is always 1 extern int Bar; B=Close [Bar];
And here always 0 C=A-B ;, and here always zero int difference=Close [1] - Close [Bars]; Folks,hint, something is stupid,
//+------------------------------------------------------------------+
//| Dimon's Bars.mq4
//| Copyright © 2010, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
extern double volume;
extern double volume,stoploss,takeprofit;
extern inttern bars;
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ int A,B,C;
A=Close [1];B=Close [bars];
C=A-B ;
int difference=Close [1]-Close [Bars];
int slippage=3;
Comment("Close [B] ", B);
while(difference> slippage)
OrderSend ( Symbol(), OP_BUY, volume, Ask, slippage,Bid-stoploss*Point,
Bid+takeprofit*Point, NULL, 0, 0, Red) ;
while(0-difference>Point)
OrderSend (Symbol(), OP_SELL, volume, Bid, slippage,Ask+stoploss*Point,
Ask-takeprofit*Point, NULL, 0, 0, Black) ;
//----
return(0);
}
//+------------------------------------------------------------------+
I'm just training to better understand mql4. I use Comment to see what's going on inside the program in general.
Dimka-novitsek
Here, here's the right thing to correct, see for yourself.
I have a lot of problems with this indicator, but I'm not sure how to fix it. I have no idea what to do with this indicator, I will be very thankful for it. I myself am a complete zero in programming.
There was an Expert Advisor like this somewhere - open a trade at random, if it closed in the red, then open the opposite one by 2 times increasing the lot. Where is it?
I think I have one of those in my toys