[Archive!] I will write any expert or indicator for free. - page 60

 

Hello! Please help me write an indicator.

Two moving averages are plotted on the price chart. Visual arrows and alerts indicate the moment of crossing. This is implemented in the indicator Ma_crossover_signal_with _waw.

We need to modify this indicator:

1. Knowing the formulas for calculating the moving average, display the closing price of the current (still being built up) candle in the working area, at which the opposite moving average crossing happens.

2. Display the closing percentage of the current candle on the working area. For example, as implemented in the BarTimer Final indicator (BarTimer option).

Adjustable parameters for the indicator: moving average calculation method (SMA, EMA...), moving average period. And if possible, the timeframe: value 0 applies to current timeframe, values 5, 15, 30, 60... - applies to M5, M15, M30, H1...

Thank you.

 
matyushevskaya:

Hello! Please help me write an indicator.

Two moving averages are plotted on the price chart. Visual arrows and alerts indicate the moment of crossing. This is implemented in the indicator Ma_crossover_signal_with _waw.

We need to modify this indicator:

1. Knowing the formulas for calculating the moving average, display the closing price of the current (still being built up) candle in the workspace, at which the opposite moving average crossing happens.

2. Display the closing percentage of the current candle on the working area. For example, as implemented in the BarTimer Final indicator (BarTimer option).

Adjustable parameters for the indicator: moving average calculation method (SMA, EMA...), moving average period. And if possible, the timeframe: value 0 applies to current timeframe, values 5, 15, 30, 60... - applies to M5, M15, M30, H1...

Thank you.


Why do something with an indicator looking to the future
 
Hi all! Please help me write a simple Expert Advisor based on moving avirage. The signal to open the following, when the MA crosses a candle wait for the candle body to exit the MA and wait for the close of the bar. If the candle closed above the MA, buy if below, then sell. Setting MA SMA20
 
arkeo:
Hi all! Please help me write a simple Expert Advisor based on moving avirage. The signal to open the following, when the MA crosses a candle wait for the candle body to exit the MA and wait for the close of the bar. If the candle closed above the MA, buy if below, then sell. Setting MA SMA20


You may have one of those EAs in all MTAs but you have to adjust shift parameter as you want. I don't think so, not all candle bodies are there. Too lazy to write such nonsense ))))

 
ZZZEROXXX:


You should only set the shift parameter as you need it. I don't think so. Too lazy to write such nonsense ))

It'll take you five minutes. I'll send you the deal copier I bought for $240.

 
arkeo:
waiting for the copier...
Files:
 
Dima_S.:
waiting for the copier...
look in the mailbox.
 

Hello all.

I am trying to make a report like this:

But I am stuck on the fact that I cannot include the account balance at the time of position opening in the report. At the moment the code looks like this:

if(Trade_Report == TRUE)
{ int pos, handle;

double Swap_M, Profit_M, Swap_P, Profit_P, Commission;
double Source_LP[RA], Source_SP[RA], Acc_Bal_Close[RA], Acc_Bal_Open[RA];

handle = FileOpen("OrdersReport.csv",FILE_CSV|FILE_WRITE);

if(handle > 0)
{
FileWrite(handle,"Time Open"+","+"Time Close"+","+"Lots"+","
+"Balance Open"+","+"Balance Close"+","+"Profit($)"+","+"Profit(p)"+","
+"SOURCE_LP"+","+"SOURCE_SP");

for(pos = 0; pos < OrdersHistoryTotal(); pos++)
{ OrderSelect(pos,SELECT_BY_POS,MODE_HISTORY); //2

Swap_M = OrderSwap();
Profit_M = OrderProfit();
Commission = OrderCommission();
Swap_P = (OrderSwap()/10)/OrderLots();
Profit_P = (OrderProfit()/10)/OrderLots()+(OrderSwap()/10)/OrderLots();

if(OrderType() == OP_BUY && OrderMagicNumber() == Magic_Source_LP && OrderCloseTime() == TimeCurrent())
{ Source_LP[pos] = Profit_M+Swap_M+Commission;
Acc_Bal_Close[pos] = AccountBalance(); }

if(OrderType() == OP_SELL && OrderMagicNumber() == Magic_Source_SP && OrderCloseTime() == TimeCurrent())
{ Source_SP[pos] = Profit_M+Swap_M+Commission;
Acc_Bal_Close[pos] = AccountBalance(); }
//---------------------------------------------------------------------------------------------------------------------
if(OrderType() < 2)
{ FileWrite(handle,TimeToStr(OrderOpenTime(),TIME_DA TE|TIME_MINUTES)+","
+TimeToStr(OrderCloseTime(),TIME_DATE|TIME_MINUTES )+","
+DoubleToStr(OrderLots(),2)+","
+DoubleToStr(Acc_Bal_Open[pos],2)+","
+DoubleToStr(Acc_Bal_Close[pos],2)+","
+DoubleToStr(Profit_M+Swap_M+Commission,2)+","
+DoubleToStr(Profit_P+Swap_P+Commission,2)+","
+DoubleToStr(Source_LP[pos],2)+","
+DoubleToStr(Source_SP[pos],2)); }
}
FileClose(handle); //2

Could someone please tell me how to add the balance values at the time of opening a trade to the report.

 
tol64:

Can someone tell me how to add the balance values at the time of opening a trade to the report?

если сделки открываются советником,
добавить значение баланса в комментарий ордера.

string comment_=DoubleToStr(AccountBalance(),2);
OrderSend(...comment_..);

затем на истории считывать баланс из комментария
double Balance_Open=StrToDouble(OrderComment());
 
KONDOR:


Thank you! It's very nice when someone responds to a request. ))

Elegant and simple option, you have to remember. I've actually already solved the problem, but it's a little more complicated:

void OnOff_Pos_Source_LP()
{  for(int count = 0; count < OrdersTotal(); count++)
      {  OrderSelect(count, SELECT_BY_POS, MODE_TRADES);
         if (OrderType() == OP_BUY && OrderMagicNumber() == Magic_Source_LP)
            {  Pos_Source_LP = TRUE;                     // Включить флаг основной позиции
               ticket_source_LP = OrderTicket();         // Присвоить глобальной переменной тикет текущей основной позиции
               Time_OpBar_Source_LP = Time[0];           // Запомнить время открытия свечи
               Acc_Balance_Open = AccountBalance(); }    // Запомнить значение баланса на открытии позиции
      }
}

And so you can memorise as many as you like. Good luck with everything!

Reason: