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

 

Good afternoon everyone!

About a week ago I started learning programming and got an interesting result. I don't know if I can trust it. I just invented the indicator a long time ago and only now I was able to implement it in the code.


 

Good evening. Please tell me where and what I did wrong!

int start()


{
int cnt, ticket, total, profit;
total = OrdersTotal();
if(total < 1)
{
ticket=OrderSend(Symbol(),OP_BUY,LotTrend,Ask,0,Ask-SL*Point,Ask+TP*Point,0,511,0,Green);
}
profit = OrderProfit();
If (OrderProfit < 0) /*if the stop loss triggered*/
{
ticket=OrderSend(Symbol(),OP_SELL,LotTrend,Bid,0,Bid+SL*Point,Bid-TP*Point,0,511,0,Red);
} /*open position in the opposite direction*/
return;
}

I get these errors:
'If' - function is not defined
'<' - left parenthesis expected
'{' - semicolon expected
PLEASE tell me what I did wrong!

 
Arles:

Good afternoon everyone!

About a week ago I started learning programming and got an interesting result. I don't know if I can trust it. I just invented the indicator a long time ago and only now I was able to implement it in the code.



Boy, this is unreal!
 
Arles:

Good afternoon everyone!

About a week ago I started learning programming and got an interesting result. I don't know if I can trust it. I just invented the indicator a long time ago and only now I was able to implement it in the code.



I've also had some strategies get bad results with this tester. You need to create a script yourself, which will test your strategy 1:1 with real conditions.
 
jelizavettka:

Man, that's unrealistic!

So there's no point in betting for real?
 
FelixFX:

I've also had some strategies get null results with this tester, so you need to create a script yourself that will test your strategy 1:1 in real conditions. You need to create a script yourself, which will test your strategy 1:1 with real conditions.

So I got excited too early...
 
Arles:

So I got excited too soon.

What's up with the stoploss in your EA?
 
jelizavettka:

What's wrong with the stoploss in your EA?

There is no stop, only a profit. Although I did it with stoploss, the result was slightly worse, I mean profit.
 
Arles:

So I got excited too soon...


Create your own script for testing, and then draw a conclusion. On the other hand it's easier to donate $100. :)

It often happens in life when brilliant ideas are not implemented because of indecision or extraneous subjective criticism.

 
Arles:

There is no stop, only a profit. Although I did it with stop, the result was a bit worse. I mean profit.

There's something wrong with the tester... Maybe it's an old build, I don't know... Most likely the EA is looking one bar into the future while trading on the past... I had a similar result once too - was unspeakably happy... but then.... I tested it on another terminal - the result was disappointing........What's your situation - I don't know... You can put it on your demo to trade, to dispel the clouds).... Better yet - post the code of indicator and EA here... The experts will point out the problem...