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

 
MaximuS60:

So as not to start pointing fingers in the sky, I will wait for an answer, or a hint.

Finally, a look into the code! It also takes the spread into account:

         if (zeroprice>Ask) //Хотите больше, поставьте несколько пипок*Point 

         if (zeroprice<Bid) //.
//                                                          











But it's better to learn seriously, not by tips! An Expert Advisor won't work for a day without proper professional supervision.

Trading is not a game, but a difficult profession that requires knowledge, hard work and often non-standard solutions due to the unpredictability of the market. I wish you prudence!

 
artmedia70:

In a string.

NULL means the current symbol. As well as Symbol() is also the current character. You have it written correctly.

Question: what type is variable RSI_1?



type double

I don't know)))) but I fixed it to NULL and it just works.

 

Hi all!

Tried to make an indicator, with three day averaging based on my custom indicator.

It draws a straight line. What could be the problem?

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Yellow

//--- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,0,2);
   SetIndexBuffer(0,ExtMapBuffer1);
   IndicatorDigits(Digits+1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int counted_bars=IndicatorCounted(),                      
    limit;
    double
    MA_1_t,                                                 
    MA_2_t,
    MA_3_t;
 
   if(counted_bars>0)
      counted_bars--;
   limit=Bars-counted_bars;
   for(int i=0;i<limit;i++)
   {
      MA_1_t=iCustom(NULL, 0, "EMAF",0,0);  
      MA_2_t=iCustom(NULL, 0, "EMAF",0,1);
      MA_3_t=iCustom(NULL, 0, "EMAF",0,2);
      {
      ExtMapBuffer1[i]=(MA_1_t + MA_2_t + MA_3_t)/3;
      }
   }
   return(0);
  }
//+------------------------------------------------------------------+
 
Forexman77:

Hi all!

Tried to make an indicator, with three day averaging based on my custom indicator.

It draws a straight line. What could be the problem?

...the mania to put brackets???

for(int i=0;i<limit;i++)
   {
      MA_1_t=iCustom(NULL, 0, "EMAF",0,i);
      MA_2_t=iCustom(NULL, 0, "EMAF",0,i+1);
      MA_3_t=iCustom(NULL, 0, "EMAF",0,i+2);
      ExtMapBuffer1[i]=(MA_1_t + MA_2_t + MA_3_t)/3;
   }
 
TarasBY:

...bracketing mania???




Thank you!!! I forgot all about the zero check) It's working!!!!

Brackets... I do that sometimes.

I wish I'd read about the correct placement, but I can't find it anywhere.

 
borilunad:

Finally, a look into the code! It also takes the spread into account:

But it's better to learn seriously, not by tips! An Expert Advisor won't work for a day without proper professional supervision.

Trading is not a game, but a difficult profession that requires knowledge, hard work and often non-standard solutions due to the unpredictability of the market. I wish you the best of luck!


thanks

but as I understand it here:

if (zeroprice>Ask)

if (zeroprice<Bid)

it checks where the CUE is, above or below the current price.

This is not an EA but a script.

Question if we can add a variable here: if (OrderModify(OrderTicket(),0,OrderStopLoss(),zeroprice+Spread,0,CLR_NONE))

 

Dear, the question is of the following nature:

where is the best place to do custom indicator averaging in the EA's code or output separately in a new indicator?

I am asking because in the tester when using custom indicators the speed of testing is significantly reduced.

 
The more indicators are called, the more slows down. When an indicator is not optimised for execution speed, one is enough for the tester to die ))))
 
MaximuS60:

thanks

But as I understand it here:

if (zeroprice>Ask)

if (zeroprice<Bid)

it checks whether the Buy is above or below the current price.

This is not an EA but a script.

The question is whether we can add a variable here: if (OrderModify(OrderTicket(),0,OrderStopLoss(),zeroprice+Spread,0,CLR_NONE))

Look in the Documentation for the rule for writing the OrderModify() trade function!

OrderModify(OrderTicket(),OrderOpenPrice(), OrderStopLoss(),zeroprice+Spread,0,Blue); //set take in / for the Buy if the position is in the negative

OrderModify(OrderTicket(),OrderOpenPrice(), OrderStopLoss(),zeroprice-Spread,0,Red); //set take on/off for sell if position is negative

OrderModify(OrderTicket(),OrderOpenPrice(),zeroprice+Spread,OrderTakeProfit(),0,Blue); //set stop loss in boolean if position is on the plus side

OrderModify(OrderTicket(),OrderOpenPrice(),zeroprice-Spread,OrderTakeProfit(),0,Red); //set stop loss in b/y for the sell if the position is on the plus side

Try it, check the logic! Check in the error log! Good luck in your studies!

 
borilunad:

Look in the Documentation for the rule of writing the OrderModify() trade function!

OrderModify(OrderTicket(),OrderOpenPrice(), OrderStopLoss(),zeroprice+Spread,0,Blue); //set take on the Buy position if it is in the red

OrderModify(OrderTicket(),OrderOpenPrice(), OrderStopLoss(),zeroprice-Spread,0,Red); //set take on/off for sell if position is negative

OrderModify(OrderTicket(),OrderOpenPrice(),zeroprice+Spread,OrderTakeProfit(),0,Blue); //set stop loss in boolean if position is on the plus side

OrderModify(OrderTicket(),OrderOpenPrice(),zeroprice-Spread,OrderTakeProfit(),0,Red); //set Stop Loss in b/c if the position is on the plus side

Try it, check the logic! Check in the error log! Good luck in your studies!


Thank you!

looking forward to the market opening!

Reason: