Vladimir, please make a switchable Martin class, because I have to manually add it to all codes to check if it works....
Thanks
//--- external input double KLot =5; // Lot multiplication factor input double MaxLot = 0.20; // Maximum lot, after which the lot is initialised input double Lots = 0.040; // Number of lots for trading //+------------------------------------------------------------------+ //| Apply Martin or reject, set KLot=1 || //+------------------------------------------------------------------+ double martin(void) { double lot=Lots; //--- Access history HistorySelect(0,TimeCurrent()); //--- Deals in history int orders=HistoryDealsTotal(); //--- Ticket of the last transaction ulong ticket=HistoryDealGetTicket(orders-1); if(ticket==0) { Print("No deals in history! "); lot=Lots; } //--- Profit of the transaction double profit=HistoryDealGetDouble(ticket,DEAL_PROFIT); //--- Transaction Lot. double lastlot=HistoryDealGetDouble(ticket,DEAL_VOLUME); //--- Profit negative if(profit<0.0) { //--- Increase the next lot lot=lastlot*KLot; Print(" The deal is closed at the stop! "); } //--- Bring the lot to a minimum double minvol=SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN); if(lot<minvol) lot=minvol; //--- If the lot is larger than the maximum lot, then the initial lot if(lot>MaxLot) lot=Lots; //--- Return trade volume return(lot); } //+------------------------------------------------------------------+ //| See the type of the last closed transaction | //+------------------------------------------------------------------+ int LastDealType(void) { int type=0; //--- Access history HistorySelect(0,TimeCurrent()); //--- Deals in history int orders=HistoryDealsTotal(); //--- Ticket of the last transaction ulong ticket=HistoryDealGetTicket(orders-1); //--- No transactions in history if(ticket==0) { Print("No deals in history! "); type=0; } if(ticket>0) { //--- Last BUY trade if(HistoryDealGetInteger(ticket,DEAL_TYPE)==DEAL_TYPE_BUY) { type=2; } //--- Last trade SELL if(HistoryDealGetInteger(ticket,DEAL_TYPE)==DEAL_TYPE_SELL) { type=1; } } //--- return(type); } //+------------------------------------------------------------------+
Vladimir, please make a switchable Martin class, otherwise I have to manually add to all codes to check the acceptability in work...
Thanks
Why? There is no need in it.
Why? It's not necessary.
I don't know...Martin is sometimes much better....
I don't know...sometimes it's much better with Martin.....
It's always better with Martin, but it's not as good without Martin.
It always works much better with martin, but without it everything is sad.
Hi
Do you use 2 or 3 stochastic oscillator for trade?
for example- stoch(5,3,3) and stoch(26,10,10) together ?
Hi
Do you use 2 or 3 stochastic oscillator for trade?
for example- stoch(5,3,3) and stoch(26,10,10) together ?
No. Usually one indicator iStochastic (Stochastic Oscillator) is used.
"Tester stopped because OnInit returns non-zero code 1"
How to solve it?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Multi Stochastic:
A multi-currency Expert Advisor based on the iStochastic (Stochastic Oscillator) indicator signals.
Author: Vladimir Karputov