Forex Factory
  • Login

  • Username: Password:
  • 5:48pm

  • Search
  • Home

  • Forums

  • Trades

  • Calendar

  • News

  • Market

  • Brokers

Options

Search
Search
Search

Subscribe to Thread

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Need help programming some indicators/EAs 64 replies

Do You Buy EAs or Indicators from ebay? 59 replies

Dreamliners’ MPAS EAs, Indicators, etc 297 replies

Future EAs Code Language? 6 replies

EAs and indicators relating to moutaki... 17 replies

  • Platform Tech
  • /
  • Reply to Thread
  • 1,097

I will code your EAs and Indicators for no charge

  • Last Post
  • First Unread
  •  
  • 1 8283Page 848586 117
  •  
  • Post# 1,661
  • Quote
  • Feb 25, 2013 12:39am
  • Damien1881
    Joined Apr 2012 | 61 Posts | Status: Member
Hi, Can anyone change the trailing stop settings for me in Vhand manual backtester. If I use a 40 pip trail it doesn't kick in until +40 bringing trade to BE . I want the trail to execute at +1 pip bringing the stop to -39 pips. If my initial stop is 40 pips, the market moves 20 pips in my favor but it means I then have 60 pips risk when I want it to move to 20 pips risk .

Here is the thread I got Vhands from-
http://www.forexfactory.com/showthread.php?t=60849

The first file is the original and the second is just part of the original with updates.
Attached File
File Type: zip vTerminal.zip   1.9 MB | 42 downloads

Attached File
File Type: zip vHands_no_monstrual_log_file.zip   14 KB | 24 downloads
  • Post# 1,662
  • Quote
  • Feb 25, 2013 1:07am
  • ~bull.bear~
    Joined Sep 2012 | 443 Posts | Status: Trade Smart !!!
Quoting Damien1881
Hi, Can anyone change the trailing stop settings for me in Vhand manual backtester. If I use a 40 pip trail it doesn't kick in until +40 bringing trade to BE . I want the trail to execute at +1 pip bringing the stop to -39 pips. If my initial stop is 40 pips, the market moves 20 pips in my favor but it means I then have 60 pips risk when I want it to move to 20 pips risk .

Here is the thread I got Vhands from-
http://www.forexfactory.com/showthread.php?t=60849

The first file is the original and the second is just part of the original...
Use this. Input is TrailingStop and point.
TrailingStop is distant in pips (40 for your case)
point depends on 4 or 5 digit broker (0.0001 or 0.01)
Magic_Num is order magic number


void Trail(int TrailingStop, double point)
{
for (int i= 0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TR ADES);
{
if (OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderType()==OP_BUY)
{
if (Bid-OrderOpenPrice()>TrailingStop*point && OrderStopLoss()<Bid-TrailingStop*point)
{
OrderModify(OrderTicket(),OrderOpen Price(),Bid-TrailingStop*point,OrderTakeProfit( ),0,Red);
}
}
if (OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderType()==OP_SELL)
{
if (OrderOpenPrice()-Ask>TrailingStop*point && OrderStopLoss()>Ask+TrailingStop*po int)
{
OrderModify(OrderTicket(),OrderOpen Price(),Ask+TrailingStop*point,Orde rTakeProfit(),0,Red);
}
}
}
}
}
**Keep Simple**
  • Post# 1,663
  • Quote
  • Feb 25, 2013 1:31am
  • hanover
    Joined Sep 2006 | 5,002 Posts | Status: Gone AWOL for a few months.....
Quoting ~bull.bear~
Please comment. Thanks.
1. S/R can provide green pips if you apply discretion in choosing which S/R levels you trade (see material like Sam Seiden, No-brainer trades, wmd's 'Deadly accuracy' trading, and Seneca_pilot's 'Ramblings' thread), and/or are skilled at micromanaging your exits. The big question is how easily this level of intelligence can be built into an EA. S/R can provide low risk entries that lead to high RR trades, and works potentially due to visibility and orderflow.

2. Using round number grid settings like TP=10 or SL=50 can not provide any kind of edge, because the market takes no cognizance of the levels used by one insignificant retail trader. The same applies to the trader's P/L; it's important personally to the trader, but it does nothing to determine imminent market behavior and probabilities.

3. Save yourself time and effort by forgetting about MM (sizing variations, loss recovery techniques, 'hedging', martingale, grids, scaling in/out etc). All of these MMs either re-balance return and risk, or redistribute wins and losses, in ways that are ultimately not sustainable. To succeed at long-term forex, you must ultimately be net long while price is rising, and net short while it's falling, frequently/heavily enough to overcome costs; no MM can overturn that fact, nor turn a red pips methodology into a winning one. The more accurately you adjust your position (entries/exits) relative to market reversals in your chosen trading horizon, the more pips you'll bank. All explained in more detail here.

My 2c.
I'm taking a rest from forums. Please don't expect replies to your posts.
  • Post# 1,664
  • Quote
  • Feb 25, 2013 1:40am
  • Damien1881
    Joined Apr 2012 | 61 Posts | Status: Member
Quoting ~bull.bear~
Use this. Input is TrailingStop and point.
TrailingStop is distant in pips (40 for your case)
point depends on 4 or 5 digit broker (0.0001 or 0.01)
Magic_Num is order magic number


void Trail(int TrailingStop, double point)
{
for (int i= 0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TR ADES);
{
if (OrderMagicNumber()==Magic_Num && OrderSymbol()==Symbol() && OrderType()==OP_BUY)
{
if (Bid-OrderOpenPrice()>TrailingStop*point ...
Thankyou but I still don't get it, I assume I have to add it here somewhere (pic attached)??
Attached Image (click to enlarge)
Click to Enlarge

Name: 2013-02-25_1735.png
Size: 37 KB
and yes I'm looking at 40 pips with a five digit broker
  • Post# 1,665
  • Quote
  • Feb 25, 2013 2:29am | Edited at 2:49am
  • ~bull.bear~
    Joined Sep 2012 | 443 Posts | Status: Trade Smart !!!
Quoting hanover
1. S/R can provide green pips if you apply discretion in choosing which S/R levels you trade (see material like Sam Seiden, No-brainer trades, wmd's 'Deadly accuracy' trading, and Seneca_pilot's 'Ramblings' thread), and/or are skilled at micromanaging your exits. The big question is...
Thanks for your comments.

I basically like trend & SR only and dislike any indicator that time my entry and exit, for the logical moves (If price is up would continue to rise for uptrend, price would shift to another area eventually because of inequilibrium of demand supply). What i trying to use grid, is to enter market as much as possible in order to get more right TP, since the price behaves up down (So to form a candle with leg or no leg). Of course probability is subjected to TF, bigger TF gives higher accuracy S&R with visible pips, smaller TF gives invisible pips or too fast ending. Meanwhile average pips per time moves is also considered to give TP to be hit as much as possible. (Exp: 1 hour average pips is +/-15 pips, daily is higher)

In fact, martingale method is to boost up profit if get the right trending moves, and i notice SR has always been retest and price bound back with trending move, but still subjects to market probability (As mentioned in previous statement).

What i think of is a trading system should have
1. Trading model (Order formation -SL, TP, total order, order types, lot) to give controllable or certain outcome with sustainable risk and as much as reward.
2. Market scenario (Probability of game)
3. MM (To increase/decrease lot for one game based on a series of game outcome)

This is why i am trying to put the trading model in the SR scenario. But i am not sure what would be the result.

Edit: What i think of Martingale + trailing stop is a good model when put into a trending strategy. Different trading model suits different market scenario.

Am i miss something?
Thanks.
**Keep Simple**
  • Post# 1,666
  • Quote
  • Feb 25, 2013 2:41am
  • ~bull.bear~
    Joined Sep 2012 | 443 Posts | Status: Trade Smart !!!
Quoting Damien1881
Thankyou but I still don't get it, I assume I have to add it here somewhere (pic attached)??Attachment 1141879 and yes I'm looking at 40 pips with a five digit broker
In the beginning of EA,
extern int TrailingStop=40;

You need a function to output "point" here, so to proceed with Trail function (because it need "point" value for input)

In somewhere of the EA that you need trail the price,
code.....
Trail(TrailingStop,point);
code...


Maybe you could add this in front of Trail function to get "point"

if (Digits==5) point=0.00001*10;
if (Digits==4) point=0.0001;
if (Digits==3) point=0.001*10;
if (Digits==2) point=0.01;
**Keep Simple**
  • Post# 1,667
  • Quote
  • Feb 25, 2013 3:22am
  • ForMeFact0ry
    Joined Feb 2012 | 131 Posts | Status: Trusted Member
i think its good to brainstorm and never stop exploring even in the name of loss.

i am game to waste my money and throw all my money away or give away to those who condemn ideas here in this thread and anywhere in the world who has internet access.

i have lived long enough to learn to ignore people completely and hope more people will do the same. its not that we dont like sincere advices. its just that people need to treat ambitious people with respect and advise gently, not with sacarsm.

anyway, on the other side of the story,
1.people who indulge in ideas and ambition does not document and publish their failed ideas. they do not provide people who has the same ideas what they did and why that idea failed. if we fail, we must tell the world that we fail and help them save time. my saying is like this: "you might care about your children and your grandchildren, but you dun give a f about your great grandchildren" i guess you be dead then, but does it matter if you live or die? it is eventually ur blood, right?
2. people who have ideas dont want to come together and commit. ive had first had experience! they hate accountability. if they got what they need, to hell w the rest.

sorry for the rambling and this is how i am, before i get banned from this thread. here's a video i created in an attempt to change people's mind that you can have -ve pips & still profit:
http://bit.ly/358pips

enjoy & take care.
bit . ly/fantestimonial1
  • Post# 1,668
  • Quote
  • Feb 25, 2013 3:23am
  • Damien1881
    Joined Apr 2012 | 61 Posts | Status: Member
Quoting ~bull.bear~
In the beginning of EA,
extern int TrailingStop=40;

You need a function to output "point" here, so to proceed with Trail function (because it need "point" value for input)

In somewhere of the EA that you need trail the price,
code.....
Trail(TrailingStop,point);
code...


Maybe you could add this in front of Trail function to get "point"

if (Digits==5) point=0.00001*10;
if (Digits==4) point=0.0001;
if (Digits==3) point=0.001*10;
if (Digits==2) point=0.01;
Thanks again , I do appreciate your help but I only just discovered meta editor last week and am really at a loss as to what to do, I haven't got a clue on how to read the code so I might just go with - "if it's not broken don't fix it" , for now , I'm sure I'll get there one day
  • Post# 1,669
  • Quote
  • Feb 25, 2013 4:38am
  • hanover
    Joined Sep 2006 | 5,002 Posts | Status: Gone AWOL for a few months.....
Quoting ~bull.bear~
Thanks for your comments. .......
Re your TA-based strategy, I can't comment on its profitability, without testing it in its every detail, over several hundred trades and (ideally) many years of changing markets. And even then, it's sometimes the subtle nuances (in both entries and exits) that veterans have learned over several years' trading, that tips the odds in their favor.

I would avoid using martingale, for the reasons given in the links in my previous post.
I'm taking a rest from forums. Please don't expect replies to your posts.
  • Post# 1,670
  • Quote
  • Feb 25, 2013 4:43am | Edited at 4:56am
  • hanover
    Joined Sep 2006 | 5,002 Posts | Status: Gone AWOL for a few months.....
Quoting ForMeFact0ry
here's a video i created in an attempt to change people's mind that you can have -ve pips & still profit:
http://bit.ly/358pips
Yes, it's possible, and for precisely the reasons that your video demonstrates. You have bigger position sizes on your winning trades than on your losses.

Hence IMO the key questions are:
--- How do you determine, in advance, which trades to put the bigger positions on?
--- Will this rationale continue to work indefinitely, or have you just made some 'lucky guesses'?

Anyway, I will leave this thread now, before the programming requests get buried too far under this discussion.
I'm taking a rest from forums. Please don't expect replies to your posts.
  • Post# 1,671
  • Quote
  • Feb 25, 2013 6:14am
  • kis
    Joined Dec 2011 | 210 Posts | Status: Member
Quoting elvee4eva
Hi Kis,

Thanks for coding the EA, but you made a mistake in the logic.

What the EA you coded does is, to close the pair of Buy and Sell whenever either the Buy or Sell hits TP, then open another pair of Buy and Sell.
Positions are closed only by TP or SL, so when TP is hit, the other position is left alone, and 2 other positions are opened.

EA doesn't close the positions only in the 2 following cases:

Quote
1. Once you achieve 10% equity increase, close all open orders and start again

2. If you get a 30% drawdown, close all open orders and begin again
However, it doesn't matter anymore, since it is based on the first trade logic you posited here:

Quote
The concept


1. Open any currency pair and choose any timeframe

2. Place a Buy order with Take Profit 10 pips and Stop Loss 100 pips and Immediately Place a Sell Order with Take Profit 10 pips and Stop Loss 100 pips.

3. Once any one of the two open orders hit Take Profit, Immediately open two new orders i.e a Buy and a Sell order with TP 10 and SL 100

4. Keep doing this and you will make at least 10% daily returns on equity.


Fine Tuning

1. Once you achieve 10% equity increase, close all open orders and start again

2. If you...
  • Post# 1,672
  • Quote
  • Feb 25, 2013 6:52am
  • FxSignals
    Joined Mar 2009 | 70 Posts | Status: Member
Hi

can you please code a simple strategy for me ?


when ea run, ope sell and buy at the current price with tp and sl (external option)

if 1 of them got tp, ea open another new buy and sell with the same sl and tp.

thanks
  • Post# 1,673
  • Quote
  • Feb 25, 2013 7:13am
  • kis
    Joined Dec 2011 | 210 Posts | Status: Member
Quoting FxSignals
Hi

can you please code a simple strategy for me ?


when ea run, ope sell and buy at the current price with tp and sl (external option)

if 1 of them got tp, ea open another new buy and sell with the same sl and tp.

thanks
Read above. Elvis requested almost the same.
  • Post# 1,674
  • Quote
  • Feb 25, 2013 9:16am | Edited at 9:21am – more explain
  • FxSignals
    Joined Mar 2009 | 70 Posts | Status: Member
Thank you Kis

but when i check the trades, the EA just set new buy and sell positions after all BUY order TP and that dose not set any new but and sell after SELL order TP.

after any tp (for buy or sell) ea must open new orders. and sl is 100 pips for each positions, no basket.

please fix it. thanks
  • Post# 1,675
  • Quote
  • Feb 25, 2013 9:32am
  • kis
    Joined Dec 2011 | 210 Posts | Status: Member
Quoting FxSignals
Thank you Kis

but when i check the trades, the EA just set new buy and sell positions after all BUY order TP and that dose not set any new but and sell after SELL order TP.

after any tp (for buy or sell) ea must open new orders. and sl is 100 pips for each positions, no basket.

please fix it. thanks
Hi,

There was a bug, it is fixed now.
But please note, that this is a very basic EA, and no error handling built in.
I think this strategy will kill your account, so don't use it live.
Attached File
File Type: ex4 elvis2.ex4   6 KB | 16 downloads
  • Post# 1,676
  • Quote
  • Feb 25, 2013 10:51am
  • FxSignals
    Joined Mar 2009 | 70 Posts | Status: Member
bug still there, in forward test after 1 tp, ea dose not open new orders.
  • Post# 1,677
  • Quote
  • Feb 25, 2013 11:04am
  • kis
    Joined Dec 2011 | 210 Posts | Status: Member
Quoting FxSignals
bug still there, in forward test after 1 tp, ea dose not open new orders.
Strange it works ok for me. Check this version, it will print error number if EA tries, but can't open position.

Do you use other EA with same magic number on that account?
Attached File
File Type: ex4 elvis2.ex4   7 KB | 21 downloads
  • Post# 1,678
  • Quote
  • Feb 25, 2013 1:08pm
  • meo10
    Joined Mar 2011 | 2 Posts | Status: Junior Member
Hi
I am writing from Italy and my english is not so good.
I thank you very much for the help you are offering to everyone.
I would like to know if it's possible to code a zig zag indicator that plots on the chart:
1) the date of each swing (DD-MM-YY)
2) the price value of each swing
3) the price value of each range between two swings
4) the number of trading bars between two swings
5) the number of calendar days between two swings (included holidays and week end)

I have found here (http://www.forexfactory.com/showthread.php?t=240156) two interesting zig zag, but the first plots only the swing points price value and the second plots only the price range and the number of bars range.
When you have time to code this zig zag I will be very very happy, but when it will be not possible, I thank you so much anyway for your work

Cristiano
  • Post# 1,679
  • Quote
  • Feb 25, 2013 1:23pm
  • FxSignals
    Joined Mar 2009 | 70 Posts | Status: Member
errors:

2013.02.25 21:51:53 elvis2(1) EURUSD,H1: Error opening short position: 129
2013.02.25 21:51:53 elvis2(1) EURUSD,H1: Long position opened: 1454977171
2013.02.25 21:51:53 elvis2(1) EURUSD,H1: open #1454977171 buy 0.10 EURUSD at 1.31771 sl: 1.30771 tp: 1.31871 ok
2013.02.25 21:51:48 elvis2(1) EURUSD,H1: Error opening short position: 129
2013.02.25 21:51:48 elvis2(1) EURUSD,H1: Error opening long position: 6
2013.02.25 21:51:22 elvis2(1) EURUSD,H1: initialized


i have just 1 buy position now
  • Post# 1,680
  • Quote
  • Feb 25, 2013 1:40pm
  • 786 trading
    Joined Oct 2007 | 465 Posts | Status: Member
I need help in coding issue. I am trying to write a script which will read a csv file and will draw horizontal lines from the file.
question 1: when i use FileReadString it gives me complete one line like EURUSD,1.3250,Red
then I use StringSubstr to extract EURUSD and 1.3250 and Red separately. Is that correct there is no way directly that I can get one by one comma separated values for one line/record?

Problem 2: I need price 1.325 to use horizontal line which require double value.
When I convert it to double var=StrToDouble("priceVar"); where priceVar = "1.3250" but it returns 1.3250000 and when I put this in object create lines for horizontal lines, it does not accept.
Evene I used NormalizeDouble function still getting lot of zeros at the end. Can I anyone hlep to read from price from text file (which will come as string) then convert it to double and remove extra zeros. Only need 5 digits after decimals.

Thanks.
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • I will code your EAs and Indicators for no charge
  • Reply to Thread
    • 1 8283Page 848586 117
0 traders viewing now
  • More

©2013 Forex Factory, Inc. / Terms of Use / Privacy Policy

Forex Factory® is a registered trademark.

Connect

  • Facebook
  • Twitter
  • RSS

Company

  • About FF
  • FF Blog
  • Careers at FF
  • Advertising
  • Contact FF

Products

  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer

Website

  • Homepage
  • Search
  • User Guide
  • Member List
  • Online Now
  • Report a Bug