[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 529

 
Pacman:


It turns out that there is no need to call parameters from the indicator. Everything can be registered directly in the EA.

I will have to figure out what my mistake is.

I rewrote my indicator with iLowest and iHighest functions, is this code correct or can it be truncated?

As soon as you bring the indicator into the EA, it is a "harrow for the horse" when working in the tester. In your case, the indicator is NOT needed!!!
 
Chiripaha:

If you set it that way, it will be different - if below the line, then... And I want it when it falls between specific lines - in the area of these lines.

Sorry, missed the brackets. Corrected the original.
 
Hi all. I'm trying tocheck my leverage. i understand that if i'm in the black i multiply this by 100 and if i go in the red it's alsomultiplied by 100, right?For example, to buy EURUSD 1lot of $1, I need 260$ in my account as a margin and I may lose 26 pips. If I do thesame withleverage 1:500,the distance of 240 pipswill decrease?
 
laveosa:
Hi all. I'm trying tocheck my leverage. i understand that if i'm in the black i multiply this by 100 and if i go in the red it's alsomultiplied by 100, right?For example, to buy EURUSD 1lot of $1, I need 260$ in my account as a margin and I may lose 26 pips. If i get thesame deal but with 1:500leveragethe distance of 240 pipswould decrease?

http://www.fxclub.org/faq/chto-takoe-kreditnoe-plecho/
 
TarasBY:

Start by grouping the conditions together:

Maybe this will make it easier to understand! (I did not go into the meaning of the code itself).


What are you doing?

    extern bool    Покупать  = false;
    extern bool    Продавать = false; 

    if (pl > Ask) 
       if (Ask > psb || Ask > ps) 
          Продавать = true;
       else if (pl < Bid) 
          if (Bid < pcs || Bid < pb) 
             Покупать = true;

It is also not possible to

 
Vinin:


What are you doing?

You can't do that.

Yes! - there is such a thing - I've lost my brackets...

    extern bool    Покупать  = false;
    extern bool    Продавать = false; 

    if (pl > Ask) {if (Ask > psb || Ask > ps) Продавать = true;}
    else {if (pl < Bid) if (Bid < pcs || Bid < pb) Покупать = true;}
- I got it right. :)
 

Okay. What's with the brackets? I'll put it in words. The style as in geometry textbooks.

if( CCI_50S>100&&CCI_50<100 ||CCI_50S>0&&CCI_50<0|| CCI_50S>-100&&CCI_50<-100 )CCInapravlenie=true

Where CCI_50S is indicator value and price on the first tick; CCI_50 is indicator value and price on the zero tick;


CCI_50S>100&&CCI_50<100 If indicator draws 100 line from top to bottom

Or

CCI_50S>0&&CCI_50<0 If the indicator crosses the zero line from top to bottom

Or

CCI_50S>-100&&&CCI_50<-100 If the indicator pierced the line minus 100 from above

then true !!!

 
Dimka-novitsek:

Okay. What's with the brackets? I'll put it in words. The style as in geometry textbooks.

Where CCI_50S is indicator value and price on the first tick; CCI_50 is indicator value and price on the zero tick;


CCI_50S>100&&CCI_50<100 If indicator draws 100 line from top to bottom

Or

CCI_50S>0&&CCI_50<0 If the indicator crosses the zero line from top to bottom

Or

CCI_50S>-100&&&CCI_50<-100 If the indicator pierced the line minus 100 from above

then true !!!


The brackets define the order in which the logical variable is calculated. No wonder you expect one thing and get another
 
TarasBY:

Yes! - there is such a thing - I've lost the brackets...

- fixed. :)

The brackets are good, of course... I've accounted for them myself (added in my mind). - It's not a problem. But this, if I understand correctly, is just a different writing style? In what way is my code wrong?

I even left only 2 lines i.e. 2 conditions. And still, when I set just one line (i.e. the situation doesn't fall under any conditions, as there is no 2nd parameter after "and"), and the program already! starts setting its own variable values. Although, the reason for this has not happened yet.

And on styles - I've tried everything - both by individual functions. And by ifs - I've created a separate one for each equal sign. And some 10 other options - nothing changes in principle.

 

How to fix it? Some terminals stopped saving trade reports (detailed reports from history and tester reports in html format).

I haven't deleted anything, I haven't tried to open terminal folders.

I have not deleted anything.