Ask! - page 23

 
TWTrader:
I am trying to add a weekly stop/target to my EA. Here is what I am trying to do...starting on Sunday begin calculating profits/loss's for the week, once a certain level is reached trading will be stopped until Fridays Close/sundays open, then the P&L will be reset. Also if the EA is started in the middle of the week it will need to know the P&L since Sunday.

Sounds like Profit Locking Feature I ask about before.... There is such a great need for this....

 

I am trying to calculate a pivot point starting at 22:00, at this time it needs to look for the high and low since midnight (00:00) and the close at 22:00. I also would like know this value at any given time. For some reason what I am using below is not working, it stays 0 until 22:00, then if the EA is reloaded it resets to 0 again. Can someone please help?

//--------Calculate P1 Pivot--------//

double LookBackHour1, LookBack1 ;

static double P1, dHigh1, dLow1, dClose1 ;

if(TimeHour(CurTime())==22 && TimeMinute(CurTime())==0)

{

LookBackHour1 = 22;

LookBack1 = MathCeil((22*60)/Period());

dHigh1 = iHigh(NULL, 0, Highest(NULL,0,MODE_HIGH,LookBack1));

dLow1 = iLow(NULL, 0, Lowest(NULL,0, MODE_LOW,LookBack1));

dClose1 = Close[0] ;

P1 = (dHigh1 + dLow1 + dClose1)/3;

}

 

universal MA cross EA

UniversalMACrossEA

https://www.mql5.com/en/forum

This EA is missing one Crucial Major feature...opening More than 1 buy or sell at a time. This is important for money management.

Setting the TP,SL on two different Buys or sells. Then close one or both when the MA crosses in the other direction and open the BUYs/Sells in the opposite direction.

This is a GURU EA along with a couple other people who modified it.

I am only half way decent with reading MQ code and modifying it, but if somebody could point me in the right direction..I'll try to modify it myself!

THANKS

 
currencyshmuck:
hello guys,

you all may know the name of this author but never knew that

his method coded into software.

Pesavento wroted among the others this wonderful books:

* Fibonacci Ratios with Pattern Recognition

* Profitable Patterns for Stock Trading

* Astro-Cycles : Traders Viewpoint

by the way i know that ENSIGN software also have his original Pesavento Patterns study tool wich can be seen in the next link.

if someone can import it from ENSIGN to MetaTrader 4 it will be amazing.

http://www.ensignsoftware.com/help/pesavento.htm

This may not be what you're looking for, but have you seen the sb_ZUP indicator from http://www.workmanworld.com/TradingFormulas/Stratoblaster/Downloads/tabid/142/Default.aspx

 

Pivot Points based on EST

I live in the UK, and my server is in CHF, so the time axis is based on Central European Standard Time. I have Pivot.mq4 (from MetaQuotes), which, therefore, calculates daily pivots based on CEST (or the summer time equivalent). However, I would like to see the pivot point calculation based on the EST (New York). My outline program would have the user enter the number of hours offset from whatever world time the user has on his screen with that of New York. Find the bars which mark yesterday's 00:00 and 23:59 then define a new day by adding the offset (in my case -6). Scan the new day for the highest high and lowest low and output the HH, LL and close for use in calculating the pivot points for today relative to EST.

I'd appreciate any suggestions/guidance.

NB I now have an excellent start from the link quoted above. http://www.workmanworld.com/TradingF...2/Default.aspx

 

how to deal iAD() function

I want to use iAD() to produce value for every bar, and then store them in to an array, then do an iMAOnArray() to this array, then output result. However my code doesn't work. Can anyone help?

int pos=Bars-ExtCountedBars;

while(pos>=0){

adarray[pos]=iAD(NULL,0,pos);

ExtMapBuffer1[pos]=iMAOnArray(adarray,0,5,0,MODE_LWMA,pos);

ExtMapBuffer2[pos]=iAC(NULL,0,pos);

pos--;

}

 
niva:
I want to use iAD() to produce value for every bar, and then store them in to an array, then do an iMAOnArray() to this array, then output result. However my code doesn't work. Can anyone help?

int pos=Bars-ExtCountedBars;

while(pos>=0){

adarray[pos]=iAD(NULL,0,pos);

ExtMapBuffer1[pos]=iMAOnArray(adarray,0,5,0,MODE_LWMA,pos);

ExtMapBuffer2[pos]=iAC(NULL,0,pos);

pos--;

}

FIll up that adarray first, then make iMaOnArray.

And u don't need second buffer adarray if u put the same values in ExtMapBuffer2. The example I attached bellow should work fine.

int pos=Bars-ExtCountedBars;

while(pos>=0){

ExtMapBuffer2[pos]=iAC(NULL,0,pos);

pos--;

}

pos=Bars-ExtCountedBars;

while(pos>=0){

ExtMapBuffer1[pos]=iMAOnArray(ExtMapBuffer2,0,5,0,MODE_LWMA,pos);

pos--;

}

 

Codersguru, I have something for you, can you PM your email address, I cannot message you because your pm box is full.

 

Is there a simple way of cloning a trend line ?

I have looked but cannot find it.

thanks

Gordon

 
gordon:
Is there a simple way of cloning a trend line ?

I have looked but cannot find it.

thanks

Gordon

Click on the trend line, to select it, then press and hold ctrl key and then just drag and drop with mouse left button.

Reason: