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

 
It is an EA.
AlexeyVik:

Read it carefully. I don't remember in detail, but code 3 is not part of Wingdings.


ps; Here is what is in the note

The special arrow codes cannot be used in the arrow display when setting the arrow value for linesthat have a DRAW_ARROW style.

This is an EA and it has a function.

 
gince:
It's the councillor.
It doesn't matter.
 
AlexeyVik:
It doesn't matter.

When can I do it?

 
gince:
This is the Expert Advisor.

There is a second function in the same advisor. Everything is fine there. (ObjectSet(objName, OBJPROP_ARROWCODE, 1);)

void f_ArrowOpen(
                  datetime openTime,
                  int action,
                  double lots,
                  string symb,
                  double openPrice
                  )
{
   color c;
   string op="";
      if(action==1)
      {
         c=Blue;
         op="BUY";
      }
      else if(action==-1)
      {
         c=Red;
         op="SELL";
      }
   // order open arrow name:    #76840865 buy 0.05 EURUSDc at 1.30416

      string objName = StringConcatenate("#", TimeToString(openTime,TIME_DATE|TIME_MINUTES), " ", op, " ", lots, " ", symb, " at ", openPrice);
      ObjectCreate(objName, OBJ_ARROW, 0, openTime, openPrice);
      ObjectSet(objName, OBJPROP_COLOR, c);
      ObjectSet(objName, OBJPROP_ARROWCODE, 1);
      ObjectSetText(objName, "LOT: " + DoubleToStr(lots, 2));
}
//+------------------------------------------------------------------+ 
void f_ArrowClose(
                  datetime closeTime,
                  int action,          //íàïðàâëåíèå
                  double lots,
                  string symb,
                  double openPrice,
                  double closePrice,
                  double profit)
{
      color c;
      string op="";
      if(action==1)
      {
         if(profit>0)c=Blue;else if(profit<0)c=Red;else c=Yellow;
         op="cl_BUY";
      }
      else if(action==-1)
      {
         if(profit>0)c=Blue;else if(profit<0)c=Red;else c=Yellow;
         op="cl_SELL";
      }
      
      string objName = StringConcatenate("#", closeTime, " ", op, " ", lots, " ", symb, " at ", openPrice, " close at ", closePrice);
      ObjectCreate(objName, OBJ_ARROW, 0, closeTime, closePrice);
      ObjectSet(objName, OBJPROP_COLOR, c);
      ObjectSet(objName, OBJPROP_ARROWCODE, 3);
      //ObjectSetText(objName, StringConcatenate("Profit: ", profit));
}
 
Please tell me. The Expert Advisor trades based on indicator signals on every bar. What should I do to have conditions checked on every tick. Here are the conditions in the indicator :
int limit, i;
int counted_bars=IndicatorCounted(); // How many bars have already been counted
if (counted_bars<0) return(-1); // Check possible error
if (counted_bars>0) counted_bars--; // count the last counted bar
limit=Bars-counted_bars; // Start from the last counted bar
// - 1 - ============================ End of block ===================================

// - 2 - ======================= Display indicator on history ======================
for(i = limit; i >= 0; i--)
{
FastMA= iMA(NULL, 0, FastMAPeriod, FastMAShift, FastMAMethod, FastMAPrice, i);
SlowMA= iMA(NULL, 0, SlowMAPeriod, SlowMAShift, SlowMAMethod, SlowMAPrice, i);

}
// - 2 - ============================ End of block ===================================

// - 3 - ======================= Signal output ========================================
//if (LastBar != Time[0]) // once per bar
//{
is this it?
 
gince:

There is a second function in the same advisor. Everything is fine there. (ObjectSet(objName, OBJPROP_ARROWCODE, 1);)

You think I'm going to convince you that you misunderstand something? You'd better spend your time on experiments and trying to understand what you've written.
 

Good afternoon, all.

Can you tell me what condition to add before OrderSend, so that the order is not executed if the previous open position is in deficit? So that there is no averaging.

 
Craft:

Good afternoon, all.

Can you tell me what condition to add before OrderSend, so that the order is not executed if the previous open position is in deficit? I want to avoid averaging.

In general, the check goes like this

OrderSelect(ticket,SELECT_BY_TICKET);

if(OrderProfit()<0) { }


And you can put anything you like in brackets. I, for example, use it this way to make the "Martin" method work)

 
Good evening, could you please tell me how the EA works. If I write return directly in the main function Start, does the EA terminate? Thanks in advance!
 
Grossmester:
Good evening, could you please tell me how the EA works. If I write return directly in the main function Start, does the EA terminate? Thanks in advance!
It only works until the next tick. And then it starts again.
Reason: