Re: Coding Help

1111
MRtools
me again, different problem.
Back a couple years ago when mt4 changed there coding we had add different commands to our code such as:

{
order_modify=OrderModify(ticket,OrderOpenPrice(),myStopLoss, myTakeProfit,0,DarkRed);
Print("BUY order opened : ------------------------------------ticket # " , ticket ," ", OrderOpenPrice());
}

{
bool order_modify=OrderModify(ticket,OrderOpenPrice(),myStopLoss, myTakeProfit,0,DarkRed); line 390 & 447 bool
Print("BUY order opened : ------------------------------------ticket # " , ticket ," ", OrderOpenPrice());
}
we had to have bool added to it to compile it. I think this stopped the "stoplose and takeprofit

extern double StopLoss = 0; // Maximum pips willing to lose per position.
extern int TakeProfit = 0; // 0= Off, Maximum profit level achieved.
from working. I think it just needs the proper command for it to work.
Could you have a look at it??
FYI; The TrailingStopType = 4; do work, I'm only loading the EA if you need be let me know and I'll load the indicators
thank you


Re: Coding Help

1112
traderduke wrote: Wed May 13, 2020 2:45 am MRtools
me again, different problem.
Back a couple years ago when mt4 changed there coding we had add different commands to our code such as:

{
order_modify=OrderModify(ticket,OrderOpenPrice(),myStopLoss, myTakeProfit,0,DarkRed);
Print("BUY order opened : ------------------------------------ticket # " , ticket ," ", OrderOpenPrice());
}

{
bool order_modify=OrderModify(ticket,OrderOpenPrice(),myStopLoss, myTakeProfit,0,DarkRed); line 390 & 447 bool
Print("BUY order opened : ------------------------------------ticket # " , ticket ," ", OrderOpenPrice());
}
we had to have bool added to it to compile it. I think this stopped the "stoplose and takeprofit

extern double StopLoss = 0; // Maximum pips willing to lose per position.
extern int TakeProfit = 0; // 0= Off, Maximum profit level achieved.
from working. I think it just needs the proper command for it to work.
Could you have a look at it??
FYI; The TrailingStopType = 4; do work, I'm only loading the EA if you need be let me know and I'll load the indicators
thank you
RK-3MA-35sq-rsiArr-BaseMA-EA-v1-wtrendwdayw9-TrlS.mq4
To be honest I'm not sure but noticed in 1 of Mladen's EA's he has

Code: Select all

if (ticket >-1)


instead of

Code: Select all

if (ticket > 0)

Re: Coding Help

1113
traderduke wrote: Wed May 06, 2020 4:56 am

Mrtools
That didn't do it. It still only shows the dots and data window for trend when "#property indicator_buffers 7". See attached/

jurik-buf#4-5-5-2020 2-41-03 PM.png

jurik-buf#7 --5-5-2020 2-41-03 PM.png

Please don't give up
Ray
Hi traderduke,
Could you please share the indicator that shows dot green line ?
Thank you.


Re: Coding Help

1116
Dear Mr. Tools, Request your help for this.

I purchased this one indicator from MQL. Would like to run multiple instances of the indicator on the same chart using different timeframes. Since the indicator does not have Multi-time frame option, would someone be able to guide me towards any other standalone indicator which can point towards the actual indicator (probably using iCustom function) and display it in multi-time frames?
Attachments

Re: Coding Help

1118
wojtek wrote: Fri May 22, 2020 9:28 am You should use the keris2112 method (from the former Forex-TSD forum) for creating MTF code.
For this purpose you need only to call the buffers using the iCustom function.
Hi Wojtek,

Thanks for your reply. I am a newbie and hardly know anything about coding. Was wondering if there was actually an indicator available which can be used to call my indicator. Appreciate all the help.

Re: Coding Help

1119
Mrtools or any one
I have converted the Chaos indicator, which re-paints, to show a 1 Or -1 at the time of the correct occurrence but 1 shift back. The problem I have is it disappears on the second candle after it occurred.
What coding will allow me to freeze the "trend1" until the next occurrence of "trend -1" and so on.

I have tried several coding steps to lock it in until the occurrence of the next change but to no avail.
Any Help would be appreciated
Ray
Never mind I got the answer.

Re: Coding Help required for 3 Level ZZ Semafor MTF indicator

1120
Hi,

Below is 3 Level ZZ Semafor MTF indicator. It gets compiled and works on FXCM MT4 platform. But on FXDD MT4 platform it gives me an error on compilation. I am getting error as in the attached screen shot. It gives an error on Return function saying "'return' - expressions are not allowed on a global scope" . I also commented out the Return function by placing a "//" in front of it and compiled. It got compiled but the Indicator did not work and showed nothing on the chart when I placed the indicator on chart after compilation. Please help. This is a very Imp Indicator for my strategy.

//+------------------------------------------------------------------+
//| MTF 3_Level_ZZ_Semafor.mq4 |
//+------------------------------------------------------------------+
// mtf2008forextsd ki kerris f-la

#property copyright "asystem2000"
#property link "asystem2000@yandex.ru"

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 White
#property indicator_color2 White
#property indicator_color3 Aqua
#property indicator_color4 Aqua
#property indicator_color5 Yellow
#property indicator_color6 Yellow

#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
#property indicator_width5 2
#property indicator_width6 2



//---- input parameters


//---- input parameters

extern int TimeFrame=0;

extern double Period1=5;
extern double Period2=13;
extern double Period3=34;
extern string Dev_Step_1="1,3";
extern string Dev_Step_2="8,5";
extern string Dev_Step_3="13,8";
extern int Symbol_1_Kod=140;//129
extern int Symbol_2_Kod=141;//130
extern int Symbol_3_Kod=142;//131

extern string note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF";
extern string Arrow_Codes = "140(129)=1; 141(130)=2; 142(131)=3";

//---- buffers
double FP_BuferUp[];
double FP_BuferDn[];
double NP_BuferUp[];
double NP_BuferDn[];
double HP_BuferUp[];
double HP_BuferDn[];
/*************************************************************************
PERIOD_M1 1
PERIOD_M5 5
PERIOD_M15 15
PERIOD_M30 30
PERIOD_H1 60
PERIOD_H4 240
PERIOD_D1 1440
PERIOD_W1 10080
PERIOD_MN1 43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
---------------------------------------
PRICE_CLOSE 0 Close price.
PRICE_OPEN 1 Open price.
PRICE_HIGH 2 High price.
PRICE_LOW 3 Low price.
PRICE_MEDIAN 4 Median price, (high+low)/2.
PRICE_TYPICAL 5 Typical price, (high+low+close)/3.
PRICE_WEIGHTED 6 Weighted close price, (high+low+close+close)/4.
You must use the numeric value of the Applied Price that you want to use
when you set the 'applied_price' value with the indicator inputs.
**************************************************************************/

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{

//---- indicator line
// if (Period1>0)
// {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,Symbol_1_Kod);
SetIndexBuffer(0,FP_BuferUp);
SetIndexEmptyValue(0,0.0);

SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,Symbol_1_Kod);
SetIndexBuffer(1,FP_BuferDn);
SetIndexEmptyValue(1,0.0);
// }

//---- Îáðàáàòûâàåì 2 áóôåð
// if (Period2>0)
// {
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,Symbol_2_Kod);
SetIndexBuffer(2,NP_BuferUp);
SetIndexEmptyValue(2,0.0);

SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,Symbol_2_Kod);
SetIndexBuffer(3,NP_BuferDn);
SetIndexEmptyValue(3,0.0);
// }
//---- Îáðàáàòûâàåì 3 áóôåð
// if (Period3>0)
// {
SetIndexStyle(4,DRAW_ARROW);
SetIndexArrow(4,Symbol_3_Kod);
SetIndexBuffer(4,HP_BuferUp);
SetIndexEmptyValue(4,0.0);

SetIndexStyle(5,DRAW_ARROW);
SetIndexArrow(5,Symbol_3_Kod);
SetIndexBuffer(5,HP_BuferDn);
SetIndexEmptyValue(5,0.0);


//---- name for DataWindow and indicator subwindow label
switch(TimeFrame)
{
case 1 : string TimeFrameStr="M1" ; break;
case 5 : TimeFrameStr= "M5" ; break;
case 15 : TimeFrameStr= "M15"; break;
case 30 : TimeFrameStr= "M30"; break;
case 60 : TimeFrameStr= "H1" ; break;
case 240 : TimeFrameStr= "H4" ; break;
case 1440 : TimeFrameStr= "D1" ; break;
case 10080 : TimeFrameStr= "W1" ; break;
case 43200 : TimeFrameStr= "MN1"; break;
default : TimeFrameStr= "CurrTF";
}
if (TimeFrame<Period()) TimeFrame=Period();

SetIndexLabel(0,"Semafor FP_BuferUp ["+TimeFrame+"])");
SetIndexLabel(1,"Semafor FP_BuferDn ["+TimeFrame+"])");
SetIndexLabel(2,"Semafor NP_BuferUp ["+TimeFrame+"])");
SetIndexLabel(3,"Semafor NP_BuferDn ["+TimeFrame+"])");
SetIndexLabel(4,"Semafor HP_BuferUp ["+TimeFrame+"])");
SetIndexLabel(5,"Semafor HP_BuferDn ["+TimeFrame+"])");

IndicatorShortName("3L_ZZ_Semafor ["+TimeFrameStr+"]");

}
//----
return(0);

//+------------------------------------------------------------------+
//| MTF |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();

// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);

limit=Bars-counted_bars;
limit=MathMax(limit,TimeFrame/Period());
// limit=MathMin(limit,MaxBarsToCount);

for(i=0,y=0;i<limit;i++)
{
// if (TimeFrame<Period()) TimeFrame=Period();
if (Time<TimeArray[y]) y++;
/***********************************************************
Add your main indicator loop below. You can reference an existing
indicator with its iName or iCustom.
Rule 1: Add extern inputs above for all neccesary values
Rule 2: Use 'TimeFrame' for the indicator time frame
Rule 3: Use 'y' for your indicator's shift value
**********************************************************/

//---- buffers

FP_BuferUp=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
Dev_Step_1,Dev_Step_2,Dev_Step_3,
Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,0,y);
FP_BuferDn=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
Dev_Step_1,Dev_Step_2,Dev_Step_3,
Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,1,y);
NP_BuferUp=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
Dev_Step_1,Dev_Step_2,Dev_Step_3,
Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,2,y);
NP_BuferDn=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
Dev_Step_1,Dev_Step_2,Dev_Step_3,
Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,3,y);
HP_BuferUp=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
Dev_Step_1,Dev_Step_2,Dev_Step_3,
Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,4,y);
HP_BuferDn=iCustom(NULL,TimeFrame,"3_Level_ZZ_Semafor",Period1,Period2,Period3,
Dev_Step_1,Dev_Step_2,Dev_Step_3,
Symbol_1_Kod,Symbol_2_Kod,Symbol_3_Kod,5,y);

}

// +++++++++++++++++++++++++++++++++++++ Refresh buffers
if (TimeFrame>Period()) {
int PerINT=TimeFrame/Period()+1;
datetime TimeArr[]; ArrayResize(TimeArr,PerINT);
ArrayCopySeries(TimeArr,MODE_TIME,Symbol(),Period());
for(i=0;i<PerINT+1;i++) {if (TimeArr>=TimeArray[0]) {
/********************************************************
Refresh buffers: buffer = buffer[0];
********************************************************/

FP_BuferUp=FP_BuferUp[0];
FP_BuferDn[i]=FP_BuferDn[0];
NP_BuferUp[i]=NP_BuferUp[0];
NP_BuferDn[i]=NP_BuferDn[0];
HP_BuferUp[i]=HP_BuferUp[0];
HP_BuferDn[i]=HP_BuferDn[0];

} } }
//+++++++++++++++++++++++++++++++++++++++++++++ Raff
return(0);
}
//+------------------------------------------------------------------+


Who is online

Users browsing this forum: No registered users and 13 guests