leedelux
20
leedelux  
Arshed Qureshi
174
Arshed Qureshi  
leedelux:
hi everyone this ea code will remove all stoploss .can someone please edit this code and make it remove profit too .please don't ask me why thank you . __________________

int ticket = OrderModify(OrderTicket(),OrderOpenPrice(),0,0,0,CLR_NONE);

FloFri
49
FloFri  

The EA is ready so far. A few questions remain, but I will have to let it run for at least 24 hours to check the behaviour. Especially at the the Sydney open (start of the cycle).

One thing that I ran across, is it the idea to keep placing stops 24/24? Further, I assumed that any remaining stop is to be removed at the Sydney open as well. But, what to do with open trades at that time?

Anyhow, the indicator at my FXDD (UTC+3, so shift = -7) demoaccount shows a PP of 1.3330, so the EA placed 1 sellstop at 1.3320.

Please let me know your findings.

f1trader
90
f1trader  

FloFri:

Close all positions at sydney open/new york close, they will only be in profit or very little loss of a few pips.

the way I check it, is to go to dailyfx.com, use there chart.

In the studies option on the chart, you can add pivot point, remember to add period 1.

the mid pivot point for EURUSD is 1.3324

The EA should have placed a buy order at 1.3334, SL 15 pips, and TP is 1.3446.

Sell Order at 1.3314, SL 15 pips, TP is 1.3250.

If SL gets triggered, re-open Sell/Buy orders again, with same SL and TP target, close all positions until either R1 or S1 is hit, or close all positions at new york closing/sydney open time.

f1trader
90
f1trader  

Sell eurusd now

Sell eurusd now, tp 1.3250.

FloFri
49
FloFri  

I can't see which data is used to get to 1.3324.

As far as I can tell (all data FXDD):

The NewYork open to be used is that of 23/4, after which we have a Low of 1.3269 and a High of 1.3399. The midpoint between these two is 1.3334.

If we see the Pivot as (L+H+C)/3, then we could involve the Sydney open (which is, at the time we initiate, the Close) of 1.3348. That would give 1.3339.

With these rates, there is no way the Pivot is lower than the midpoint.

There is one other thing I don't get, and that's:

If in your scenario, the mid pivot point for EURUSD is 1.3324, and the Sydney open is 1.3348, then how could the EA have placed "a buy order at 1.3334"? A stop order that is. We cannot place a buystop order below the market!

Please elaborate, I assure you that, annoying as my questions may be, you'll get a working EA in return, eventually. I guess I am not stupid (fortunately have other proof for that), but in this case I must be thinking along different lines, missing your point!

f1trader
90
f1trader  
FloFri:
I can't see which data is used to get to 1.3324.

As far as I can tell (all data FXDD):

The NewYork open to be used is that of 23/4, after which we have a Low of 1.3269 and a High of 1.3399. The midpoint between these two is 1.3334.

If we see the Pivot as (L+H+C)/3, then we could involve the Sydney open (which is, at the time we initiate, the Close) of 1.3348. That would give 1.3339.

With these rates, there is no way the Pivot is lower than the midpoint.

There is one other thing I don't get, and that's:

If in your scenario, the mid pivot point for EURUSD is 1.3324, and the Sydney open is 1.3348, then how could the EA have placed "a buy order at 1.3334"? A stop order that is. We cannot place a buystop order below the market!

Please elaborate, I assure you that, annoying as my questions may be, you'll get a working EA in return, eventually. I guess I am not stupid (fortunately have other proof for that), but in this case I must be thinking along different lines, missing your point!

In regards to the pivot point. If we go to DailyFX - Currency Trading News, Forex Trading News, FX News, Forex News and use there chart, we go to the studies option and add pivot point with period 1. That is the pivot point we are using.

The calculation of the pivot is standard, it is just the timeframe you are using, and you have to adjust accordingly.

I cannot give you exact settings of the indicator I use because of the timeframe metatrader platform will be different to mine. But to be brief, the mid-pivot is calculated on the new york open and new york close. Established at Sydney Open time. When working with timeframes, there is always a universal problem all the time because we all work from different time frames. Please adjust your mid-pivot (by trying different time frames, e.g. GMT+2, GM2+3 etc), until your midpivot is the same as the one on the dailyfx chart (pivot point study, period 1), as it is highly unlikely that there pivot point calculation is wrong.

EURUSD (Pivot Points) - Forex Trading, Currency Forecast, FX Trading Signal, Forex Training Course, Education, Tutorial, FX Book, Forex ebook, Learn to Trade Forex, FX Guide, Pivot Points, Currency Rates, Forex Secret, Forex Brokers, Currency Trading

Actionforex mid pivot calculation is 1.3327, which is not far from 1.3324 (my calculation), and very far from 1.3334 (your calculation).

Dukascopy pivot point is 1.3329. Which is halfway between mine and yours.

http://www.dukascopy.com/swiss/english/marketwatch/pivot/

But the pivot point calculation I have been using for backtest is the one according to dailyfx chart (studies/pivotpoint).

In regards to the buy stop order.

Basically, as soon as price hits 10 pips above pivot we want to buy. Whether the price is coming from above the entry level or below the entry level. (My backtest is based on this rule).

The reason I do not like to use buylimit order is because, if the price starts above the buy entry level, and it is coming down, it may hit exactly 10 pips above the pivot, and then reverse back up. But with a buy limit order, it will take the spread into consideration, and will only trigger the buy order if the price hits 8 pips above the pivot (on a 2 pip spread), this way we could have missed the trade completely.

I am not being picky about 1-2 pips, but whilst backtesting, I have seen this on several occasions, where the price comes up or down, and hits exactly 10 pips away from the pivot and then reversing onto the next pivot level, taking the trade into profit zone.

Today was a bad day, as no clear trend was defined, the mid-pivot was whipsawed several times.

As a general rule, I would stop trading, once the stop loss has been hit about 8 times in a day, leaving a maximum loss of 120 pips. This can be made up in the future trades.

I hope I have been clear, if you have any more questions, let me know.

f1trader
90
f1trader  

Try your pivot point calculation, you may get better results.

FloFri
49
FloFri  

Ok, Pivot Point checked. Funny shifting. About the not-stop buy/selling, I haven't programmed this. I will check it out.

Cheers!

---> just read your message just above this one. Well I don't know...You had these results with your original, right!? Anyway, this can be taken care of in the settings later...

f1trader
90
f1trader  

FloFri:

It would be good, if in the settings we could change the SL level, TP level (either R1, R2, R3, S1, S2, S3, or a number of pips), and the entry level (how many pips away from the pivot).

So that we can do proper backtesting of the EA to get the optimum levels for the best results.

Once we can find the optimum levels, with the best risk:reward ratio, we can add martingale feature, which would mean almost 85-95% profit every month. < Key to this strategy.

We can than later add a money management feature if the above is succesful.