Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 667

 
Forexman77:

I don't know if this will help?

But, try calculating "LOW-delta;" on a separate line with the result in a separate variable and then passing it to "OrderSend"

Like this:


That's such a great idea...

extern double delta = 350;
int start()
{
   double stop;
   double LOW = iLow(NULL,0,1);  

The LOW in this case is (for EURUSD, approximately) 1.3525

if(Close[1]<Open[1])
   { 
    stop=LOW-delta;
    send=OrderSend(Symbol(), OP_BUY, Lot,Ask,10,NormalizeDouble(stop*Point,Digits),0,NULL,Magic,0,Green);
   }

and then you subtract 350 from 1.3525... how much do you think you'll get and is it possible to stop it? Even if you normalize what you get.

Although, I have not checked it. Maybe it won't make an error, it will just put a stop below zero?

 
AlexeyVik:

You have such a great idea...

The LOW in this case is (for EURUSD approximately) 1.3525

and then you subtract 350 from 1.3525... how much do you think you'll get and is that a stop??? Even if you normalize what you got.

Although, I haven't checked. Maybe it won't make an error, it'll just stop below zero?

This is how it should be:

if(Close[1]<Open[1])
   { 
    stop=LOW-delta*Point;
    send=OrderSend(Symbol(), OP_BUY, Lot,Ask,10,NormalizeDouble(stop*Point,Digits),0,NULL,Magic,0,Green);
   }

Or rather, this is how it is in my Expert Advisor. I copied it wrong).

 
Forexman77:

That's the way it should be:

Or rather, that's how it is in my EA. I copied it wrong)


And again with an error...
 
AlexeyVik:

And again with a mistake...
What was the error? The advisor closed properly.
 
Forexman77:
What's wrong? The advisor closed as it should.


if(Close[1]<Open[1])
   { 
    stop=LOW-delta*Point;
    send=OrderSend(Symbol(), OP_BUY, Lot,Ask,10,NormalizeDouble(stop*Point,Digits),0,NULL,Magic,0,Green);
   }
 
AlexeyVik:

if(Close[1]<Open[1])
   { 
    stop=LOW-delta*Point;
    send=OrderSend(Symbol(), OP_BUY, Lot,Ask,10,stop,0,NULL,Magic,0,Green);
   }
 
Forexman77:
if(Close[1]<Open[1])
   { 
    stop=LOW-delta*Point;
    send=OrderSend(Symbol(), OP_BUY, Lot,Ask,10,stop,0,NULL,Magic,0,Green);
   }


and hello again )))) normalisation is lost somewhere this time. what's the rush?
 
Hello, could you please tell me how to get and update the _tst offline chart? I only have GBP and EUR,but I need AUDUSD, USDCAD, USDCHF, NZDUSD. I need the charts for the Simple Forex Tester manual strategy tester. Thanks in advance.
 
Maybe someone has done this: there are several open orders (let's say 4) of which let's say 2 with positive profit and 2 with negative profit. We should draw a matrix of combinations of sums of profits (for example, 1 positive and 1 negative, 1 positive and 2 negative, 2 positive and 1 negative, etc.). Then identify those combinations that add up to a given profit (positive of course) and close those orders.
 
A variable needs to be added to the EA. If an order closes at a stop loss, for example to sell, then a new order should also open only to sell.
Reason: