META TRADER 4 THREAD NOW ON KRESLIK.COM

Moderator: moderators

marc
rank: <50 posts
rank: <50 posts
Posts: 11
Joined: Sat Jan 12, 2008 8:55 pm
Reputation: 0
Gender: Male

Postby marc » Sun Jan 13, 2008 10:58 am

Hi!

THX, Skyline!

On chart we have bid prices. When do we buy, when our bid price hits the entry or our ask price?

We do it one each hour or as many time the price hits our entry levels within that hour?

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 11404
Joined: Sun May 14, 2006 9:31 pm
Reputation: 45
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Re: TRO BUY ZONE WITH HISTORY

Postby TheRumpledOne » Sun Jan 13, 2008 3:25 pm

Skyline wrote:Hi TRO,
this version of your TRO BUY ZONE will work fine on every timeframe lower than H1 and show also the lines on history chart.

Hope you like it ;)

Code: Select all

//+------------------------------------------------------------------+
//|                                                TRO BUY ZONE .mq4 |
//|                                                     Skyline,2008 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Skyline,2008"
#property link      "www.forexpertutti.it"

#property indicator_chart_window
#property  indicator_buffers 5
#property  indicator_color1  White
#property  indicator_color2  Blue
#property  indicator_color3  Blue
#property  indicator_color4  Red
#property  indicator_color5  Red

double OpenLine[];
double BuyLine1[];
double BuyLine2[];
double SellLine1[];
double SellLine2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(0,OpenLine);   
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(1,BuyLine1); 
   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(2,BuyLine2);
   SetIndexStyle(3,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(3,SellLine1); 
   SetIndexStyle(4,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(4,SellLine2);       
//   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4);
//   SetIndexBuffer(1,ShortBuffer);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
//----
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   
   limit=Bars-counted_bars;
   
   for (int i=0; i<limit; i++)
   {
    int BarShift  = iBarShift(NULL,PERIOD_H1,Time[i],true);
    double OpenH1 = iOpen(NULL,PERIOD_H1,BarShift);
    OpenLine[i]  = OpenH1;
    BuyLine1[i]  = OpenH1+3*Point;
    BuyLine2[i]  = OpenH1+4*Point;
    SellLine1[i] = OpenH1-3*Point;
    SellLine2[i] = OpenH1-4*Point;
   
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+


Thanks... I learned a new trick.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!

Please do NOT PM me with trading or coding questions, post them in a thread.

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

Re: TRO BUY ZONE WITH HISTORY

Postby Skyline » Sun Jan 13, 2008 4:10 pm

TheRumpledOne wrote:
Skyline wrote:Hi TRO,
this version of your TRO BUY ZONE will work fine on every timeframe lower than H1 and show also the lines on history chart.

Hope you like it ;)

Code: Select all

//+------------------------------------------------------------------+
//|                                                TRO BUY ZONE .mq4 |
//|                                                     Skyline,2008 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Skyline,2008"
#property link      "www.forexpertutti.it"

#property indicator_chart_window
#property  indicator_buffers 5
#property  indicator_color1  White
#property  indicator_color2  Blue
#property  indicator_color3  Blue
#property  indicator_color4  Red
#property  indicator_color5  Red

double OpenLine[];
double BuyLine1[];
double BuyLine2[];
double SellLine1[];
double SellLine2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(0,OpenLine);   
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(1,BuyLine1); 
   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(2,BuyLine2);
   SetIndexStyle(3,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(3,SellLine1); 
   SetIndexStyle(4,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(4,SellLine2);       
//   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4);
//   SetIndexBuffer(1,ShortBuffer);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
//----
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   
   limit=Bars-counted_bars;
   
   for (int i=0; i<limit; i++)
   {
    int BarShift  = iBarShift(NULL,PERIOD_H1,Time[i],true);
    double OpenH1 = iOpen(NULL,PERIOD_H1,BarShift);
    OpenLine[i]  = OpenH1;
    BuyLine1[i]  = OpenH1+3*Point;
    BuyLine2[i]  = OpenH1+4*Point;
    SellLine1[i] = OpenH1-3*Point;
    SellLine2[i] = OpenH1-4*Point;
   
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+


Thanks... I learned a new trick.


You're welcome TRO ;)

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

Postby Skyline » Sun Jan 13, 2008 4:13 pm

And this is another version with the green profit target set at 10 pips from open price ;)
So basically for the Buy Zone method you enter whenever the price enter the related zone with a fixed sl of 5/7 pips and exit at profit target line ?

Code: Select all

//+------------------------------------------------------------------+
//|                                                TRO BUY ZONE .mq4 |
//|                                                     Skyline,2008 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Skyline,2008"
#property link      "www.forexpertutti.it"

#property indicator_chart_window
#property  indicator_buffers 7
#property  indicator_color1  White
#property  indicator_color2  Blue
#property  indicator_color3  Blue
#property  indicator_color4  Red
#property  indicator_color5  Red
#property  indicator_color6  Green
#property  indicator_color7  Green

double OpenLine[];
double BuyLine1[];
double BuyLine2[];
double SellLine1[];
double SellLine2[];
double TargetLine1[];
double TargetLine2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(0,OpenLine);   
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(1,BuyLine1); 
   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(2,BuyLine2);
   SetIndexStyle(3,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(3,SellLine1); 
   SetIndexStyle(4,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(4,SellLine2);       
   SetIndexStyle(5,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(5,TargetLine1); 
   SetIndexStyle(6,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(6,TargetLine2);     
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
//----
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   
   limit=Bars-counted_bars;
   
   for (int i=0; i<limit; i++)
   {
    int BarShift   = iBarShift(NULL,PERIOD_H1,Time[i],true);
    double OpenH1  = iOpen(NULL,PERIOD_H1,BarShift);
    OpenLine[i]    = OpenH1;
    BuyLine1[i]    = OpenH1+3*Point;
    BuyLine2[i]    = OpenH1+4*Point;
    SellLine1[i]   = OpenH1-3*Point;
    SellLine2[i]   = OpenH1-4*Point;
    TargetLine1[i] = OpenH1+10*Point;
    TargetLine2[i] = OpenH1-10*Point;   
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 11404
Joined: Sun May 14, 2006 9:31 pm
Reputation: 45
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Sun Jan 13, 2008 4:47 pm

Image

Hey Skyline:

I made a slight mod to your code... I added user inputs so they can change the targets and I there is just one entry trigger line instead of 2

Code: Select all

//+------------------------------------------------------------------+
//|               _BZ_SKYLINE                      TRO BUY ZONE .mq4 |
//|                                                     Skyline,2008 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Skyline,2008"
#property link      "www.forexpertutti.it"

#property indicator_chart_window
#property  indicator_buffers 7
#property  indicator_color1  White
#property  indicator_color2  Blue
//#property  indicator_color3  Blue
#property  indicator_color3  Red
//#property  indicator_color5  Red
#property  indicator_color4  LimeGreen
#property  indicator_color5  LimeGreen

extern double myEntryTrigger   = 4 ;
extern double myProfitTarget   = 6 ;
extern double myStopLoss       = 7 ;


double OpenLine[];
double BuyLine1[];
double BuyLine2[];
double SellLine1[];
double SellLine2[];
double TargetLine1[];
double TargetLine2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(0,OpenLine);   
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(1,BuyLine1); 
//   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
//   SetIndexBuffer(2,BuyLine2);
   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(2,SellLine1); 
//   SetIndexStyle(4,DRAW_LINE,STYLE_DASH);
//   SetIndexBuffer(4,SellLine2);       
   SetIndexStyle(3,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(3,TargetLine1); 
   SetIndexStyle(4,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(4,TargetLine2);     
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
//----
   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   
   limit=Bars-counted_bars;
   
   for (int i=0; i<limit; i++)
   {
    int BarShift   = iBarShift(NULL,PERIOD_H1,Time[i],true);
    double OpenH1  = iOpen(NULL,PERIOD_H1,BarShift);
    OpenLine[i]    = OpenH1;
    BuyLine1[i]    = OpenH1+myEntryTrigger*Point;
//    BuyLine2[i]    = OpenH1+4*Point;
    SellLine1[i]   = OpenH1-myEntryTrigger*Point;
//    SellLine2[i]   = OpenH1-4*Point;
    TargetLine1[i] = OpenH1+myProfitTarget*Point;
    TargetLine2[i] = OpenH1-myProfitTarget*Point;   
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

Postby Skyline » Sun Jan 13, 2008 5:04 pm

TheRumpledOne wrote:Hey Skyline:

I made a slight mod to your code... I added user inputs so they can change the targets and I there is just one entry trigger line instead of 2



Yeah that's perfect TRO ! I forgot to put those values as external variables :oops: :roll:

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 11404
Joined: Sun May 14, 2006 9:31 pm
Reputation: 45
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Sun Jan 13, 2008 5:52 pm

Ok, then you can add ZoneWidth as an external and plot the lines I removed...LOL
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 11404
Joined: Sun May 14, 2006 9:31 pm
Reputation: 45
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Mon Jan 14, 2008 5:13 pm

Image

I added the vertical hour line.


Code: Select all



//+------------------------------------------------------------------+
//|               _BZ_SKYLINE                      TRO BUY ZONE .mq4 |
//|                                                     Skyline,2008 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Skyline,2008"
#property link      "www.forexpertutti.it"

#property indicator_chart_window
#property  indicator_buffers 7
#property  indicator_color1  White
#property  indicator_color2  Blue
//#property  indicator_color3  Blue
#property  indicator_color3  Red
//#property  indicator_color5  Red
#property  indicator_color4  LimeGreen
#property  indicator_color5  LimeGreen

extern double myEntryTrigger   = 4 ;
extern double myProfitTarget   = 6 ;
extern double myStopLoss       = 7 ;

extern color  myHourColor   = DarkGray ;
extern int    myStyle       = STYLE_DOT;

double OpenLine[];
double BuyLine1[];
double BuyLine2[];
double SellLine1[];
double SellLine2[];
double TargetLine1[];
double TargetLine2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(0,OpenLine);   
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(1,BuyLine1); 
//   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
//   SetIndexBuffer(2,BuyLine2);
   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(2,SellLine1); 
//   SetIndexStyle(4,DRAW_LINE,STYLE_DASH);
//   SetIndexBuffer(4,SellLine2);       
   SetIndexStyle(3,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(3,TargetLine1); 
   SetIndexStyle(4,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(4,TargetLine2);     
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
//----

   if( TimeHour(Time[0] ) != TimeHour(Time[1]) )
     {
               
     double level= (High[1] + Low[1] + Close[1]) / 3;
     SetTimeLine("HourStart", "Hour", 0, White, level+10*Point); // draw the vertical bars that marks the time span
     }


   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   
   limit=Bars-counted_bars;
   
   for (int i=0; i<limit; i++)
   {
    int BarShift   = iBarShift(NULL,PERIOD_H1,Time[i],true);
    double OpenH1  = iOpen(NULL,PERIOD_H1,BarShift);
    OpenLine[i]    = OpenH1;
    BuyLine1[i]    = OpenH1+myEntryTrigger*Point;
//    BuyLine2[i]    = OpenH1+4*Point;
    SellLine1[i]   = OpenH1-myEntryTrigger*Point;
//    SellLine2[i]   = OpenH1-4*Point;
    TargetLine1[i] = OpenH1+myProfitTarget*Point;
    TargetLine2[i] = OpenH1-myProfitTarget*Point;   
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
void SetTimeLine(string objname, string text, int idx, color col1, double vleveltext)
{
   string name= "[PIVOT] " + objname;
   int x= Time[idx];

   if (ObjectFind(name) != 0)
      ObjectCreate(name, OBJ_TREND, 0, x, 0, x, 100);
   else {
      ObjectMove(name, 0, x, 0);
      ObjectMove(name, 1, x, 100);
   }
   
   ObjectSet(name, OBJPROP_STYLE, myStyle);
   ObjectSet(name, OBJPROP_COLOR, myHourColor);
   
   if (ObjectFind(name + " Label") != 0)
      ObjectCreate(name + " Label", OBJ_TEXT, 0, x, vleveltext);
   else
      ObjectMove(name + " Label", 0, x, vleveltext);
           
   ObjectSetText(name + " Label", text, 8, "Arial", col1);
}
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

User avatar
JoeSDF
rank: <50 posts
rank: <50 posts
Posts: 1
Joined: Wed Jan 09, 2008 6:28 pm
Reputation: 0
Location: Louisville, KY
Gender: Male

Postby JoeSDF » Mon Jan 14, 2008 5:44 pm

TRO / Skyline - I really like the changes you two have made. When I copy and paste TRO's above code somehow I've lost the Buy Zone numbers which usually show in the upper right-hand corner of my chart. Is there any way to get this back? The RANGE numbers show OK because it's a separate indicator. Also might we have separate external inputs for the Buy Zone so it appears correct when I use this on the Cable? Nice work guys.
Best regards,
Joe SDF

toddanderson
rank: <50 posts
rank: <50 posts
Posts: 7
Joined: Sat Dec 02, 2006 12:25 pm
Reputation: 0
Gender: None specified

Please post the indicator

Postby toddanderson » Mon Jan 14, 2008 5:56 pm

Could you please post the indicator, when i copy,paste the code
I dont get it to work nor can I compile it,
or i am doing something stupid





TheRumpledOne wrote:Image

I added the vertical hour line.


Code: Select all



//+------------------------------------------------------------------+
//|               _BZ_SKYLINE                      TRO BUY ZONE .mq4 |
//|                                                     Skyline,2008 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Skyline,2008"
#property link      "www.forexpertutti.it"

#property indicator_chart_window
#property  indicator_buffers 7
#property  indicator_color1  White
#property  indicator_color2  Blue
//#property  indicator_color3  Blue
#property  indicator_color3  Red
//#property  indicator_color5  Red
#property  indicator_color4  LimeGreen
#property  indicator_color5  LimeGreen

extern double myEntryTrigger   = 4 ;
extern double myProfitTarget   = 6 ;
extern double myStopLoss       = 7 ;

extern color  myHourColor   = DarkGray ;
extern int    myStyle       = STYLE_DOT;

double OpenLine[];
double BuyLine1[];
double BuyLine2[];
double SellLine1[];
double SellLine2[];
double TargetLine1[];
double TargetLine2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(0,OpenLine);   
   SetIndexStyle(1,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(1,BuyLine1); 
//   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
//   SetIndexBuffer(2,BuyLine2);
   SetIndexStyle(2,DRAW_LINE,STYLE_DASH);
   SetIndexBuffer(2,SellLine1); 
//   SetIndexStyle(4,DRAW_LINE,STYLE_DASH);
//   SetIndexBuffer(4,SellLine2);       
   SetIndexStyle(3,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(3,TargetLine1); 
   SetIndexStyle(4,DRAW_LINE,STYLE_DOT);
   SetIndexBuffer(4,TargetLine2);     
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit;
//----

   if( TimeHour(Time[0] ) != TimeHour(Time[1]) )
     {
               
     double level= (High[1] + Low[1] + Close[1]) / 3;
     SetTimeLine("HourStart", "Hour", 0, White, level+10*Point); // draw the vertical bars that marks the time span
     }


   //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   
   limit=Bars-counted_bars;
   
   for (int i=0; i<limit; i++)
   {
    int BarShift   = iBarShift(NULL,PERIOD_H1,Time[i],true);
    double OpenH1  = iOpen(NULL,PERIOD_H1,BarShift);
    OpenLine[i]    = OpenH1;
    BuyLine1[i]    = OpenH1+myEntryTrigger*Point;
//    BuyLine2[i]    = OpenH1+4*Point;
    SellLine1[i]   = OpenH1-myEntryTrigger*Point;
//    SellLine2[i]   = OpenH1-4*Point;
    TargetLine1[i] = OpenH1+myProfitTarget*Point;
    TargetLine2[i] = OpenH1-myProfitTarget*Point;   
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
void SetTimeLine(string objname, string text, int idx, color col1, double vleveltext)
{
   string name= "[PIVOT] " + objname;
   int x= Time[idx];

   if (ObjectFind(name) != 0)
      ObjectCreate(name, OBJ_TREND, 0, x, 0, x, 100);
   else {
      ObjectMove(name, 0, x, 0);
      ObjectMove(name, 1, x, 100);
   }
   
   ObjectSet(name, OBJPROP_STYLE, myStyle);
   ObjectSet(name, OBJPROP_COLOR, myHourColor);
   
   if (ObjectFind(name + " Label") != 0)
      ObjectCreate(name + " Label", OBJ_TEXT, 0, x, vleveltext);
   else
      ObjectMove(name + " Label", 0, x, vleveltext);
           
   ObjectSetText(name + " Label", text, 8, "Arial", col1);
}

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “MetaTrader”