Re: Coding Help

793
vvFish wrote: Tue Aug 28, 2018 2:27 pm Dear coders, help to change the thickness of the line to the maximum, so that it does not return to its original state.
I'm only interested in two lines.
Thanks in advance. :|
Change lines 54 and 56 from

Code: Select all

SetIndexStyle(0,DRAW_LINE,0,2); 
SetIndexStyle(1,DRAW_LINE,0,2);  
to

Code: Select all

SetIndexStyle(0,DRAW_LINE); 
SetIndexStyle(1,DRAW_LINE);  
that will make those 2 lines be width = 1 after you change those 2 lines on the top you can add

Code: Select all

#property indicator_width1 = 5
#property indicator_width2 = 5
just put the width to 5 but you can put it any width.
These users thanked the author mrtools for the post:
vvFish

Re: Coding Help

794
mrtools wrote: Tue Aug 28, 2018 2:42 pm

Change lines 54 and 56 from

Code: Select all

SetIndexStyle(0,DRAW_LINE,0,2); 
SetIndexStyle(1,DRAW_LINE,0,2);  
to

Code: Select all

SetIndexStyle(0,DRAW_LINE); 
SetIndexStyle(1,DRAW_LINE);  
that will make those 2 lines be width = 1 after you change those 2 lines on the top you can add

Code: Select all

#property indicator_width1 = 5
#property indicator_width2 = 5
just put the width to 5 but you can put it any width.
Thank you
"Only the price on the chart can show the entrance to the deal..."

Re: Coding Help

795
Hello Mladen amd Mrtools, i need your help coding an indicator show up arrows when Super trend is up and down arrows when is down, my code is the fallow but only show up arrows, thanks in advance.

double ST(int i)
{
double up = iCustom(Symbol(),0,"SuperTrend nrp (new format)",0,i);
double dn = iCustom(Symbol(),0,"SuperTrend nrp (new format)",1,i);

if(up)
{
return(1);
}
if(dn)
{
return(-1);
}

return(0);
}

bool Arrowup(int i)
{
bool up=false;

up = ST(i)==1;

if(up)
{
return true;
}
return false;

}
bool Arrowdn(int i)
{
bool dn=false;

dn = ST(i)==-1;

if(dn)
{
return true;
}
return false;
}


Re: Coding Help

796
Cladi39 wrote: Sun Sep 09, 2018 3:51 am Hello Mladen amd Mrtools, i need your help coding an indicator show up arrows when Super trend is up and down arrows when is down, my code is the fallow but only show up arrows, thanks in advance.

double ST(int i)
{
double up = iCustom(Symbol(),0,"SuperTrend nrp (new format)",0,i);
double dn = iCustom(Symbol(),0,"SuperTrend nrp (new format)",1,i);

if(up)
{
return(1);
}
if(dn)
{
return(-1);
}

return(0);
}

bool Arrowup(int i)
{
bool up=false;

up = ST(i)==1;

if(up)
{
return true;
}
return false;

}
bool Arrowdn(int i)
{
bool dn=false;

dn = ST(i)==-1;

if(dn)
{
return true;
}
return false;
}
Think it would be better to use the indicator you posted and use the buffer called "Direction" to make the arrows.If you want to make it separate indicator can do the iCustom call to the Direction buffer#3.

Re: Coding Help

797
mrtools wrote: Sun Sep 09, 2018 11:56 am

Think it would be better to use the indicator you posted and use the buffer called "Direction" to make the arrows.If you want to make it separate indicator can do the iCustom call to the Direction buffer#3.
Thanks soo much Mrtools.

Re: Coding Help

798
Hi Mladen and Mr Tools, may you kindly please assist in your available time to add the alerts variables ( on current, pop, sound, push , email , etc) and arrows to one of forex station indicators - Detrended Synthetic Price (mtf oscillator) 1.1 indicator? Thanks very much Sincerely Appreciated

Re: Coding Help

799
Can someone help me make this work with the usdjpy-4 format
it works with the standard usdjpy format
oanda for some reason adds the -4 tag on all pairs and I think that is why it is not working, Thanks!

Code: Select all

//+------------------------------------------------------------------+
//|                                                    ChgTF-All.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, zznbrm"
#property show_inputs

#import "user32.dll"
   int      PostMessageA(int hWnd,int Msg,int wParam,int lParam);
   int      GetWindow(int hWnd,int uCmd);
   int      GetParent(int hWnd);
#import

extern int eintTF = PERIOD_M5;
                   
int start()
{      
   bool blnContinue = true;   
   int intParent = GetParent( WindowHandle( Symbol(), Period() ) );   
   int intChild = GetWindow( intParent, 0 );  
   int intCmd; 
   
   switch( eintTF )
   {
      case PERIOD_M1:   intCmd = 33137;  break;
      case PERIOD_M5:   intCmd = 33138;  break;
      case PERIOD_M15:  intCmd = 33139;  break;
      case PERIOD_M30:  intCmd = 33140;  break;
      case PERIOD_H1:   intCmd = 35400;  break;
      case PERIOD_H4:   intCmd = 33136;  break;
      case PERIOD_D1:   intCmd = 33134;  break;
      case PERIOD_W1:   intCmd = 33141;  break;
      case PERIOD_MN1:  intCmd = 33334;  break;
   }
   
   if ( intChild > 0 )   
   {
      if ( intChild != intParent )   PostMessageA( intChild, 0x0111, intCmd, 0 );
   }
   else      blnContinue = false;   
   
   while( blnContinue )
   {
      intChild = GetWindow( intChild, 2 );   
   
      if ( intChild > 0 )   
      { 
         if ( intChild != intParent )   PostMessageA( intChild, 0x0111, intCmd, 0 );
      }
      else   blnContinue = false;   
   }
   
   // Now do the current window
   PostMessageA( intParent, 0x0111, intCmd, 0 );
}

Re: Coding Help

800
I found a guy on youtube and wrote this its not great but it works
there is a weird popup at the end

Code: Select all

//+------------------------------------------------------------------+
//|                                                changerthingy.mq4 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                              |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      ""
#property version   "1.00"
#property strict
#property show_inputs

extern ENUM_TIMEFRAMES tf=240;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
long firstchart = ChartFirst();
while(firstchart>0)
{
ChartSetSymbolPeriod(firstchart,ChartSymbol(firstchart),tf);
firstchart=ChartNext(firstchart);
}

   
  }
//+------------------------------------------------------------------+


Who is online

Users browsing this forum: No registered users and 15 guests