[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 627

 

I only have one position in the market...so it won't miss...

if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES))

 
rigonich:

If you want me not to answer your questions - just say so.

No no!!! I want to, but I don't want you to do any extra work... you're already REALLY helpful... so what I've managed to find out myself (you can't just ask and sit around doing nothing!) - I'll delete it quickly...
 
rigonich:

OrderModify(OrderTicket(),OrderLots( ),stop_loss,OrderTakeProfit( ), 0,CLR_NONE);

Wait, so you have a lot -- 0.


Thanks for that!!!!

here's where to think....

this line is from the "modify" function - I didn't write it myself, but inserted it ready-made, and it works.... maybe "0" means the current position size? but I'd rather fix it to a value - thanks lots are fixed

 
rigonich:

OrderModify(OrderTicket(),OrderLots( ),stop_loss,OrderTakeProfit( ), 0,CLR_NONE);

Stop, so your lot is 0.


no lots in modify :))))))) there's an opening price for some reason...

OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)
 
lottamer:


there are no lots in the modification :))))))) there is an opening price for some reason...

OrderModify( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)


Right, I got it mixed up when copying and pasting, can't get used to pasting in comments, if copied from help, it's pasted as a link.

In my own case, to insert a function with many parameters, I copy it from the help and replace the parameters with the ones I need, one by one\, so as not to get confused.

 

Dear all!

Downloaded and launched PFG FX traider (latest version). Tried to make an indicator.

Immediately two puzzles:

1. My indicator is visible from under the editor, opens and everything, but I can't find it on the file system. Not at all, not even by searching.

2. indicator opens file - writes ticks. It writes and crashes but I can't find the file either!!!!

How can this be? Windows 7.

 

Brothers, don't ignore a beginner's effort !

Need a ready-made script (or something like that) that would indicate in the archives

movements on the schedule filtered by momentum and time.

For example, the movement started at 14.00 and finished at 14.45.

And the amount of movement was 410 points (in five-digit calculation).

So, is there a script that would visually mark such moves on the chart "in the past"?

and that the force-time values can be inserted independently.

______

Please indicate a branch or a place where they can advise how to do it.

In programming - not Aristotle, but I suspect that such a script is not difficult to make.

___

Ready to share what seems to have been found, and most importantly - the parameters for the filter by time and strength.

 
Chibrikin:

Dear all!

Downloaded and launched PFG FX traider (latest version). Tried to make an indicator.

Immediately two puzzles:

1. My indicator is visible from under the editor, opens and everything, but I can't find it on the file system. Not at all, not even by searching.

2. indicator opens file - writes ticks. It writes and crashes but I can't find the file either!!!!

How can this be? Windows 7.


In Semester, some files are sometimes not placed in the terminal, but in D:\Users\user nameAppData\Local\VirtualStore\Program Files, then the name of the terminal

This often happens if several terminals are installed in different directories or there are a lot of indicators, EAs or other user files accumulated in the terminal.

 
TUNGUS:

Brothers, don't ignore a beginner's effort !

Need a ready-made script (or something like that) that would indicate in the archives

movements on the schedule filtered by momentum and time.

For example, the movement started at 14.00 and finished at 14.45.

And the amount of movement was 410 points (in five-digit calculation).

So, is there a script that would visually mark such moves on the chart "in the past"?

and that the force-time values can be inserted independently.

______

Please indicate a branch or a place where they can advise how to do it.

In programming - not Aristotle, but I suspect that such a script is not difficult to make.

___

Ready to share what seems to have been found, and most importantly - the parameters for the filter by time and strength.


I don't understand at all what you want from the script.
 

Help is urgently needed, I'm totally confused. Here is the trading function and the order modification function:

void OrdersModifying(double& sl, double& tp)
{
  int total = OrdersTotal() - 1;
  sl = 0; tp = 0;
  
  for(int i=total; i>=0; i--)
  {
    if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == true)                            // Если ордер есть и он выбран..
    {
      if(g_type == OP_BUY)
      {
        if(i_sl != 0)                                                                 // Если входной параметр стоп-лосса не равен 0, то..
           sl = NormalizeDouble(OrderOpenPrice() - i_sl*pt,Digits);                    // Получаем значение стоп-лосса для выбранного ордера
        if(i_tp != 0)                                                                 // Если входной параметр тейкпрофита не равен 0, то..
           tp = NormalizeDouble(OrderOpenPrice() + i_tp*pt,Digits);                    // Получаем значение тейкпрофита для выбранного ордера
      }
      if(g_type == OP_SELL)
      {
        if(i_sl != 0)                                                                 // Если входной параметр стоп-лосса не равен 0, то..
           sl = NormalizeDouble(OrderOpenPrice() + i_sl*pt,Digits);                // Получаем значение стоп-лосса для выбранного ордера
        if(i_tp != 0)                                                                 // Если входной параметр тейкпрофита не равен 0, то..
           tp = NormalizeDouble(OrderOpenPrice() - i_tp*pt,Digits);                // Получаем значение тейкпрофита для выбранного ордера
      }
      if(sl != 0 || tp != 0)                                                            // Если полученные значения sl и tp не равныы 0, то..
      {
        OrderModify(g_ticket,OrderOpenPrice(),sl,tp,OrderOpenTime() + 86400,Lime);      // Модифицируем ордер
      }
    }
  }
}
bool OpenBuy()
{
  g_ticket = -1;
  string myNote = "сов баянул";
  
  if(GetPriceToInput() < Ask)
  {       
    g_ticket = OrderSend(Symbol(),OP_BUYLIMIT,0.1,GetPriceToInput(),3,0,0,myNote,myMagic,0,Blue);
  }
    if(g_ticket > 0 && OrderSelect(g_ticket,SELECT_BY_TICKET,MODE_TRADES) == true)
 
  return(true);
}
bool OpenSell()
{
  g_ticket = -1;
  string myNote = "сов шортанул";
 
  if(GetPriceToInput() > Bid)
  {
    g_ticket = OrderSend(Symbol(),OP_SELLLIMIT,0.1,GetPriceToInput(),3,0,0,myNote,myMagic,0,Red);
  }
    if(g_ticket > 0 && OrderSelect(g_ticket,SELECT_BY_TICKET,MODE_TRADES) == true)
  
  return(true);
}
bool Trade (int signal)
{
  FindOrders();

  if(signal == SIGNAL_BUY)                                                          // Если сигнал на покупку и открытых ордеров нет..
    if(!OpenBuy())                                                                  // открываем лимитный ордер на покупку
      return(false);                                                                
      
  if(signal == SIGNAL_SELL)                                                       // Если сигнал на продажу и открытых ордеров нет..
     if(!OpenSell())
       return(false);                                                              // открываем лимитный ордер на продажу
  
  OrdersModifying(sl, tp); - ТУТ НЕ ВЪЕЗЖАЮ КАК БЫТЬ

  return(true);
}

I currently have order modification not working, although when several functions were in one, everything worked. But I want all the functions to be separated for convenience. In general, I would like to have functionOrdersModifying to modify orders. I understand that logically it should be pasted into Trade function where I have pasted it, but we have to pass 2 parameters sl and tp from functionOrdersModifying into it.

Have I correctly passed sl and tp parameters to theOrdersModifying function ?

Reason: