[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 318

 
Azerus:


How it? I have it in indicator line settings after int init()

ArrayInitialize(Buffer,EMPTY_VALUE);

You give the default value in the init.

 
snail09:

Thanks, it all worked out......
 

Hi all, can you tell me what you can think of? In the indicator, there is an external parameter - extern bool save = false;, then you need to manually switch to - save = true; and the program will remember something. But when you change timeframe, you need to reset the parameter to - false;.

Run, with true, and when you change the timeframe, to change it to false?

 

Well, what's the problem

int init(){int ctf=Period();}

int start(){
if (ctf!=Period()) save=false;
....


 
 

more precisely, the ctf declaration must be placed before init

int ctf;
int init(){ctf=Period();}
 
Or static in the inite? No?
 
fore-x:

The problem is that after a timeframe change, the value of the external variable is not reset in the indicator properties, or is this not possible?


You write an indicator (EA), compile it, the ex4 file will contain default values of external variables, correct me? You were offered a variant to react in case of TF change, it did not suit you. There are other options, but they are less trivial.
 
dofer-dert:

Need help changing an EA

The Expert Advisor should trade on the reverse.

Instead of sell limit orders buy

and buy limit orders sell

Strange, this is the first time I've seen it reversed "sell limit -> buy" and " buy limit -> sell". There is a current Bid and Ask, possible allowable levels for setting pending orders including stoplevels and freezes, but how to simply do the opposite of what you suggest - I have no idea. It completely changes the logic. Well, calculate the allowable parameters of the OrderSend function for your conditions, consider restrictions, and just - try. You can also look at the debugging information...
 
snail09:
Strange, this is the first time I've seen "sell limit -> buy" and "buy limit -> sell" reversed. There are current Bid and Ask, possible acceptable levels for setting pending orders including stoplevels and freezes, but how to simply do the opposite of what you suggest - I have no idea. It completely changes the logic. Well, calculate the acceptable parameters of the OrderSend function for your conditions, consider restrictions, and just - try. You may also look at the debugging information...

I haven't specified it myself...:-) but maybe here the author wants to turn a debugging TC into a punching one...:-) and that's it.
 
snail09:
... but how to simply do the opposite of what you suggest is beyond me. The logic changes completely. Well, calculate permissible parameters of the OrderSend function for your conditions, consider restrictions, and just - try it. You can also look at the debugging information...
There's nothing difficult to change the entry conditions considering asc, bid, etc. of all the requirements and organisms when making trades - example.
Reason: