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

 
artmedia70:
Don't let your head drink. It'll get loose :)
And in "God" you hope, but don't make a mistake!
 
borilunad:
Trust in "God", but make no mistake about it!

He must always have "the example" in front of him.
 
Vinin:

He's always got an "example" in front of him.
Cheers!
 

Please advise, I have written a simple program. It sets buystop and sellstop orders. I used simple scripts from the tutorial, but they do not work during sharp price movements. I should get them triggered at any price:

if (condition)

{ here is where I need the script};

Thanks in advance



 
solnce600:

Please advise.

It means that the price could not go down by more than 230 pips on any of the positions.

Why does the tester show the equity drawdown at 244 points?

If the price lost 244 points on some position, the stop-loss would be triggered.



After the stop, the new order slipped 14 pips.

I read the last few pages with your reasoning. You considered the worst case scenarios. Let's assume you believe that after a stop loss (if there is one) you will definitely post a profit. In that case 1$x400pp=$400 (40% drawdown), then you increase the lot 1.5 times, then you need to take into account that before reaching the profit, the possible drawdown is 398pp, which gives us another (1.5$x398pp=$597). As a result we get bankruptcy, this is without taking into account the deposit.

 
oDin48:


After the stop, the new order has dropped by 14 pips.

Read the last few pages with your reasoning. You have considered the worst case scenarios, there is something to add: let's say you are sure that after the stop (if there is one) there will definitely be a profit. In that case 1$x400pp=$400 (40% drawdown), then you increase the lot 1.5 times, then you need to take into account that before reaching the profit, the possible drawdown is 398pp, which gives us another (1.5$x398pp=$597). As a result we get bankruptcy, this is without taking into account the margin.

That is why it is better to start from FreeMargin and not from Equity!
 
I want to write an MQL4 Expert Advisor, I want to trade on the Moving Average, something that crosses one price and I enter a trade, so how to read the iMA function and compare it with another one?)
 
An example of such an (well, almost) advisor is at https://www.mql5.com/ru/articles/1385
 
LBatters:
I want to write an MQL4 Expert Advisor, I want to trade on the Moving Average, something that intersects another one and I enter a trade, so how to read the iMA function price to compare it to another price read?)



How to get a signal when two MAs cross

From here

 

Hello!

Could you please tell me what error is being displayed in this example

and how to write another value (double var2=1.123) to this file

and how do I read these values from the file?

An example from MQL4 Reference File operations FileWriteDouble

 int handle; double var1=0.345; handle=FileOpen("mydata.dat", FILE_BIN|FILE_WRITE); if(handle<1) { Print("can't open file error-",GetLastError()); return(0); } FileWriteDouble(h1, var1, DOUBLE_VALUE); // FileClose(handle);