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

 
rustein:

How to calculate the maximum allowable lot size? error: 0.0000 failed [Not enough money].

Thank you.



The calculation in the tutorial here at Percent = 100% will be the maximum lot size for your dept.
 
Roman.:

the tutorial calculation here at Percent = 100% would be the maximum lot size for your dept.

Thank you, I have it like this, where is the error?

//-----
  double MinLot        = MarketInfo(Symbol(),MODE_MINLOT);
  double MaxLot        = MarketInfo(Symbol(),MODE_MAXLOT);
  double MeansOneLot   = MarketInfo(Symbol(),MODE_MARGINREQUIRED);
  double MeansFree     = AccountFreeMargin();
  double MeansGuaranty = AccountMargin();
  double MaxLotAllowed = MathFloor((MeansFree/MeansOneLot)*100)/100;
//----- Select Lot size
  if(MManagement == true)  Lots=NormalizeDouble(AccountBalance()*MaximumRisk/100.00/100.00,LotsDigits);
  if(MManagement == false) Lots=Lots;
//-----
  if(Lots <= MinLot) Lots=MinLot;
  if(Lots >= MaxLot) Lots=MaxLot;
  if(Lots >= MaxLotAllowed) Lots=MaxLotAllowed;
//+------------------------------------------------------------------+
 

guys help create a function

at

if(signal)

draw lines:

first yellow, if the signal to sell and the price went below the yellow line and the signal is still there, then draw a closed line and so on until the signal subsides,

If the signal is above the yellow line and the yellow line is still there, then we draw a blue line. . suggest an option.

I want to test how deep the signals are.

It's like when fishing, when a fish tries a feeder, but has not yet swallowed, to understand when to pull it should feel, because every fish has its own way to the hook.

That's the same thing with signals, I think.


I started, but I can't figure out what I did wrong.

I don't know how to do a proper check to make sure it draws lines higher or lower.

Files:
 

Somehow I read in the tutorial that all arrays are static and have static type by default, but in fact it turned out that they are not as static as they should be.

In one and the same code, if you set static variable bool tratata1, it keeps its value but if you replace it with bool tratata[1], it doesn't keep its value. Again, I only change one variable in the same code.

 
Read the documentation. The sections: Variable Types, and Program Execution, are all described in detail.
 
FAQ:
Please help me too, where is the mistake?
 
AccountFreeMargin()/MarketInfo(Symbol(),MODE_MARGINREQUIRED)
Maximum number of lots that can be bought with available funds
 
//-----
  double MinLot        = MarketInfo(Symbol(),MODE_MINLOT);
  double MaxLot        = MarketInfo(Symbol(),MODE_MAXLOT);
  double MeansOneLot   = MarketInfo(Symbol(),MODE_MARGINREQUIRED);
  double MeansFree     = AccountFreeMargin();
  double MeansGuaranty = AccountMargin();
  double MaxLotAllowed = MeansFree/MeansOneLot;
//----- Select Lot size
  if(MManagement == true)  Lots=NormalizeDouble(AccountBalance()*MaximumRisk/100.00/100.00,LotsDigits);
  if(MManagement == false) Lots=Lots;
//-----
  if(Lots <= MinLot) Lots=MinLot;
  if(Lots >= MaxLot) Lots=MaxLot;
  if(Lots >= MaxLotAllowed) Lots=MaxLotAllowed;
//+------------------------------------------------------------------+
Thank you for your help.
 

Tell me how to write an EA on this condition:

There are three currency pairs on which the EA will open deals and the EA is attached to only one chart and on the other two it works by itself, in general, multicurrency.

The second condition is when the price reaches a certain level on any of the currency pairs, a deal opens. Only one deal can be opened at a time.

As soon as the deal is closed, the Expert Advisor can reopen the deal at any of the pairs if the price approaches.

I have set a static variable so that as long as the variable's value is false, the deals are allowed to be opened and as soon as the order is opened on any of the pairs, the variable takes the value true. As soon as the order is closed and the for loop cannot find any trade, the variable takes the value false again.

And if for example only one trade should be opened for each of the pairs, it means that each pair has its own variable.

Is there a more rational solution to this problem?

 
Please tell me how to make an alert that will signal when a new candle starts, but is not time based (for RANGE charts).