Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1127
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Well I have been since 1997)
See, there is a tick and with it a signal, and if you get an error, it needs to be processed. Processed and query again, but before query you can zero the variable with error, then at next query if there is an error, it will go into variable again, but if there is no error, it will be "0".
You don't have to zero the variable, but if there is an error, it will return a new value. In any case, you should not be interested in the error that you had last time on the last tick, you should process only what you have "now".
So again, this is on mql5. And I need it on mql4.
I'm duplicating my question in this thread as the mql5 thread couldn't help - no one knows the answer.
I have this function and it works in my Expert Advisor/Script
{
double One_Lot=0.0;
double price=0.0;
double volume=0.0;
double MinLot=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MIN);
double Free=AccountInfoDouble(ACCOUNT_FREEMARGIN);
double Step=SymbolInfoDouble(symbol,SYMBOL_VOLUME_STEP);
if(action==ORDER_TYPE_BUY)price=SymbolInfoDouble(symbol,SYMBOL_ASK);
if(action==ORDER_TYPE_SELL)price=SymbolInfoDouble(symbol,SYMBOL_BID);
if(!OrderCalcMargin(action,symbol,1.0,price,One_Lot))return(MinLot);
if(One_Lot!=0 && Step!=0)volume = MathFloor(Free*Percent/100.0/One_Lot/Step)*Step;
if(volume!=0)return(volume);
return(MinLot);
}
Question:how to get the maximum possible lot in an indicator,OrderCalcMargin does not work in an indicator for some reason? I tried to useOrderCalcMargin but it doesn't work in mt4.
Thank you!
how to do it?
so that when
OnDeinit(REASON_CHARTCHANGE)
Continue as normal without resetting (ignore this cause completely, it's an info panel with levels)
how to do it?
so that when
OnDeinit(REASON_CHARTCHANGE)
Continue as normal without resetting (ignore this cause completely, it's an info panel with levels)
No way.
Well, there are ways around that.
I'm too lazy to cram levels into the code for each tool out of 40 existing ones.
It's easier to make it automatic and click the TF with symbols as you like.
And at the same time, I'm looking for a way to specify the muving values of the higher TF on the lower oneWell, there are ways around that.
I'm too lazy to cram levels into the code for each tool out of 40 existing ones.
It's easier to make it automatic and click the TF with symbols as you like.
And at the same time, I'm looking for a way to specify muving values for major TFWrite the settings to a file and read them in the init. There is no way to bypass deinit, it does not ask for permission.
Why not bypass deinit by writing to a file, if at all possible? e.g. in case of deinitialisation initiate a startup with previous parameters
Isn't this what I wrote above?
Okay, so we wrote the required settings into the file, closed it, and what?
In theory, it should now re-open the Expert Advisor with the required parameters, and how can a text file do this (I don't see any other functions in the list, although in this case, you need an exe)?