Ask! - page 91

 

Putz, what do you mean, "seems to work"? Either it is working or it is not. if it does work for the first order, then you should base your second order upon it (use OrderOpenPrice() as the basis of your second order instead of your currentlow like the first one).

 
khari123:
Can someone help me with a script or ea that forces only 1 trade per day? Thanks A Bunch

Use daily chart, put:

#property ...

static bool ITradedOnThisBar;

//+---------------------------+

//| expert initialization function |

//+---------------------------+

then, on your opening and closing conditions add:

ITradedOnThisBar!=Bars

and after OrderSend():

ITradedOnThisBar=Bars;

 

HI!

How make a n EA based on stop&reverse of position???

Stop&reverse -> order_buy = order_closesell and orderseel=order_closebuy

Tnx for help!

 
metastock:
HI!

How make a n EA based on stop&reverse of position???

Stop&reverse -> order_buy = order_closesell and orderseel=order_closebuy

Tnx for help!

Try this script... experts\scripts

Files:
 

Step 1 and 2 working

Hi Sendra,

I just wanted to say thanks and let you know that I now have steps one and two working properly. Now I am working on steps 3 and +++. It's turning into a great exercise in learning.

Step 3 is trying to find out which indicator is the best to use to find the long term trend. I'm looking at Daily for now as it seems to work best for my system.

The one thing that I want to try is to find a way to confirm the change of trend as it seems that many times, most indicators show a change of thread, it reverses at that point and turns out to be nothing more than a retracement. I think that I would like to confirm the trend when the price passes the high or the low of the previous bar by x number of pips. I'm sure that somebody has already coded this but I have not been able to find it yet. If anybody has any suggestions, I would appreciate it.

Regards,

Putz

 

Hi there,

I created my first indicator and really happy about it. What I have is a 2map (1hour and daily) for trading only with the major trend.

On the 1hour chart it works perfectly, but if I lower the TF the signals change....can anybody tell me how to make the signal appear on the close of the 1hour candle even on a lower TF chart ? Is that possible ?

 
MFM:
Hi there,

I created my first indicator and really happy about it. What I have is a 2map (1hour and daily) for trading only with the major trend.

On the 1hour chart it works perfectly, but if I lower the TF the signals change....can anybody tell me how to make the signal appear on the close of the 1hour candle even on a lower TF chart ? Is that possible ?

As usual, you can only discover bar opening, i.e. that it is the first tick on a new bar, and then you can use a predicate like the following:

bool atHourBarOpen()

{

if ( TimeCurrent() != Time[0] )

return( false ); // Not the first tick of the bar

return( TimeHour( Time[1] ) != TimeHour( Time[0] ) );

}
 
ralph.ronnquist:
As usual, you can only discover bar opening, i.e. that it is the first tick on a new bar, and then you can use a predicate like the following:
bool atHourBarOpen()

{

if ( TimeCurrent() != Time[0] )

return( false ); // Not the first tick of the bar

return( TimeHour( Time[1] ) != TimeHour( Time[0] ) );

}

thanks for your help, but i can't get my head around the issue. I am attacching the indicator, if you could have a look at it I would appreciate it very much. Would it be possible to have the signal come on the close of the TF specified in First_Map and not hard conditioned on the 1hr? This way if I change the TF in first map it will work on that one.

 

Putz

Hi, Putz,

Try to use GlobalVariable and iHigh()/iLow().

Maybe like this:

//---- input parameters

string ChangeTrendBar;

int start()

double H1=iHigh(NULL,0,1);

double H0=iHigh(NULL,0,0);

...

if(xnow>ynow && xprevious<yprevious) // signal that trend has change

{

GlobalVariableSet("BarTrendChange",Time[0]);

}

if(GlobalVariableGet("BarTrendChange")==Time[1])

{

if(H1<H0 && H0-H1=n-pip)

...

Hope it works.

 

How to put Expiration day on the indicator

Dear all trader,

I want to know how to put an expiration date in indicator or EA, so that it has an expiration days like picture below. What string code should be added in .mtq?

Thanks in advance.

Files: