[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 152

 
Fartarantula:

So it turns out that externally I can't change the contents of a condition that, when checked, executes an expression.

Is there really no way to do this?

If you don't like something in the predefined function itself, you should write your own.
 
Fartarantula:

So it turns out that externally I can't change the contents of a condition that, when checked, executes an expression.

Is there really no way to do this?


I have described the method to you in detail.
 
FAQ:

......

2) An external variable is a constant and cannot be initialised by an expression.

You can, but it is better not to do so. You can get confused later. It is a variable just like all the others.
 
No way, it's technically a constant, and behaves accordingly.
 
FAQ:
No way, it's technically a constant and behaves accordingly.

You can assign any value to an external variable in your code.

Try this:

extern int Param = 1234;

void start()
 {
  Alert(Param);
  Param = 4321;
  Alert(Param);
 }
 

Hello,

I am making a buffer for a price.

double open[5];
int start() {

Specified what to show - it shows normally.

open[i]=max2;

But all 5 readings are the same - I want to write the 5 last readings.

ArraySetAsSeries(open,true);
for(i = 1; i < 5; i++){
open[i] = open[i-1];
}

I don't understand what else needs to be done?

 
You can, but you can also re-define the constant.
 
FAQ:
You can, but you can also re-define a constant.

Define and constant are not exactly the same thing.

A define is defined and initialized at the preprocessor level. It does not change during operation. It is hardwired into the code.

A constant is, in other words, a variable which is initialized once per one block call. In the process the constant can have different values.

In our case, an external variable is an ordinary variable with a manual initialisation option.

 
r772ra:

How can one value be higher and lower than another at the same time

maybe || (logical OR) should be written instead of && ?
 
I have a question. If for example a series of BUY trades has a profit factor -1.01, then it would be better to open a series of SELL trades with parameters reversed. i.e. if buy take was 200 pips and stop 100, then buy 100 and stop 200 for SELL? Am I thinking correctly?