MQL4 - automated forex trading   /  

Forum

help with windows

Back to topics list To post a new topic, please log in or register

avatar
15
tkelvisa 2008.02.04 23:01 
can someone give me example of code that create some window where i can put some values and later a can use that imput in my expert advisor.



thanks
article

Interview with CodersGuru

"Raymond Toh have said in one of his articles: “There’s no way to make profit trading Forex without firmly established rules and the discipline to obey them”. You can not obey your rules if you trade manually, believe me I tried manual trading and lost a lot of money. For the peace of your mind you have to find a programmer and describe your manual practice to him and he will give you back an Expert Advisor that makes your manual trading 100% automated!"


avatar
2462
phy 2008.02.04 23:04 

Have the EA read a label in the chart window, and change the label to give data to the EA


avatar
15
tkelvisa 2008.02.04 23:09 
phy wrote:

Have the EA read a label in the chart window, and change the label to give data to the EA

i'm not sure that you understand me.
i would like when i start my EA that pop up window apear and to ask me to write e.g. "buy limit price" so i don't need
to go into e.a.

avatar
2462
phy 2008.02.04 23:15 
tkelvisa wrote:
phy wrote:

Have the EA read a label in the chart window, and change the label to give data to the EA

i'm not sure that you understand me.
i would like when i start my EA that pop up window apear and to ask me to write e.g. "buy limit price" so i don't need
to go into e.a.


Well, that is "difficult"

Have the EA create a label in the window that says "Input Buy Limit Price Here" and select it, and change the text to your limit price.

Try it, or not. You have asked this same question more than once with little response.



avatar
15
tkelvisa 2008.02.04 23:24 
phy wrote:
tkelvisa wrote:
phy wrote:

Have the EA read a label in the chart window, and change the label to give data to the EA

i'm not sure that you understand me.
i would like when i start my EA that pop up window apear and to ask me to write e.g. "buy limit price" so i don't need
to go into e.a.


Well, that is "difficult"

Have the EA create a label in the window that says "Input Buy Limit Price Here" and select it, and change the text to your limit price.

Try it, or not. You have asked this same question more than once with little response.


Have the EA create a label in the window that says "Input Buy Limit Price Here" and select it.


yes but i need help how to do it!!!


thanks

avatar
2462
phy 2008.02.04 23:59 

ObjectCreate() object type OBJ_LABEL

ObjectSetText() to set the label text

ObjectDescription() to read the value you store in the label

StrToDouble() to convert the text string in the label to a price value


avatar
189
edddim 2008.02.05 10:34 
Does this could help?
int start()
  {
   bool draw=1;
   double orderPrice;
   int orderTicket[1],li,order,lenth;
   string text,type[4],
    desc="BuySellLimitStop Price",
    txt=StringConcatenate(Symbol(),Period(),"BSLSO");
   type[0]="BuyLimit";
   type[1]="SellLimit";
   type[2]="BuyStop";
   type[3]="SellStop";
 // ... conditions ...
   if ( draw == true ) // if conditions needed
   {
    if(ObjectFind(txt)<0)Text(txt,desc);
   }
 // search for order send
   if(ObjectFind(txt)>-1)
   {
    if(ObjectDescription(txt)!=desc)
    {
     text=ObjectDescription(txt);
     for(li=0;li<4;li++)
     {
      if(StringFind(text,type[li],0)>-1)
      {
       order=li+2;
       break;
      }
     }
     orderPrice=StrToDouble(StringSubstr(text,StringLen(type[2]+1)));
     // ... #include trade ... 
     orderTicket[0]=OrderSend(Symbol(),order,orderPrice,10,0.0,0.0,"",0,0,Green);
     Comment("OrderType ",type[li]," is integer = ",order,", at Price ",orderPrice);
     if(orderTicket[0]>0)
     {
      if(ObjectFind(txt)>-1)
      {

       ObjectDelete(txt);
       orderTicket[0]=0;
      }
     }
    }
   }
   return(0);
  }
//+------------------------------------------------------------------+
  void Text(string _LN, string _LT) {
      if(ObjectFind(_LN)<0) ObjectCreate(_LN, OBJ_LABEL, 0, 0, 0);
      ObjectSet( _LN, OBJPROP_CORNER, 1);
      ObjectSet(_LN, OBJPROP_XDISTANCE, 10.0);
      ObjectSet( _LN, OBJPROP_YDISTANCE, 10.0);
      ObjectSetText (_LN, _LT, 12, "Arial Bold", LightSeaGreen);
  return;}
As input should be clear writte "BuyLimit" or other with followed space (as written) and price.
Back to topics list  

To add comments, please log in or register