mql4 trade in trend line that i draw

 

hi there, im new in mql4 

1_i want drew trend lines in deffrent H1 charts manual, and i want set order on trend line(  i should find price bellow or up the candle crossing from trendline) with expert ,any one knows how can i do it?

2_how can in mention a "special" currencys open candle_ price, for example how can i use eur/jpy H1 open candle price?

 
ejmin ejoni:

hi there, im new in mql4 

1_i want drew trend lines in deffrent H1 charts manual, and i want set order on trend line(  i should find price bellow or up the candle crossing from trendline) with expert ,any one knows how can i do it?

2_how can in mention a "special" currencys open candle_ price, for example how can i use eur/jpy H1 open candle price?

#property copyright "Copyright © 2005-09, HaskayaFx Yazılım"
#property link      "http://www.haskayayazilim.net"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
// OnReadObj();
   int     total; 
  string obj_name; 
  double obj_Price=0;
  
     total=ObjectsTotal();
     for(int i=0;i<total;i++)
       {
        
        obj_name=ObjectName(i); 
        obj_Price=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE1),Digits);
        if(Close[0]>obj_Price && Open[0] <obj_Price)
        {
         Alert(Symbol()+" TF:"+string(Period())+" Close Above on Obj_Line");
         // Open Buy Orders Code
         ObjectDelete(obj_name);
        }
        
        if(Close[0]<obj_Price && Open[0]>obj_Price)
        {
         Alert(Symbol()+" TF:"+string(Period())+" Close  Below on Obj_Line");
         //OPen Sell Orders
         ObjectDelete(obj_name);
        }
       
       } 
 }      
//+------------------------------------------------------------------+ 
//| Script program start function                                    | 
//+------------------------------------------------------------------+ 

void OnReadObj()
  {
//---
   int     total; 
  string obj_name; 
  double obj_PriceStart=0;
  double obj_PriceEnd=0;
 // string SearchStringName="LINE12-";
  
  
     total=ObjectsTotal();
     for(int i=0;i<total;i++)
       {
       obj_name=ObjectName(i);
        if(ObjectType( obj_name)==OBJ_TREND) 
        //&&  (StringFind(obj_name,SearchStringName,0)!=-1))
        {
         
        obj_PriceStart=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE1),Digits);
        obj_PriceEnd=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE2),Digits);
        
        Print("Obj Name ",obj_name," Start Price=",obj_PriceStart," End Price=",obj_PriceEnd);
        
         
        }
        
       
      
       } 
 }      
Reason: