I code your strategy into an EA

Moderator: moderators

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Tue May 11, 2010 10:49 pm

hey newschool, if you are still around and if you have a moment, would you please try to code this strategy into an ea:

5M Chart
any currency
this are the rules

Long Entry
1) RED CANDLE CLOSES
2) GREEN CANDLE CLOSES
3) PRICE TOUCHES HIGH OF PREVIOUS GREEN CANDLE - ENTER LONG

Short Entry
1) Green Candle closes
2) Red Candle Closes
3) Red Candle Touches lowest of previous red canlde - Enter SHORT

Exit will again be trailing sl, to be optimized by the pair or reverse signal, which ever comes first.

if possible, a filter can be added, which is to take long trades only when the cci is above 0 and only shorts when it is below, with the cci set to 333.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
newschool
rank: 150+ posts
rank: 150+ posts
Posts: 489
Joined: Fri Aug 21, 2009 2:26 am
Reputation: 1
Gender: Male

Postby newschool » Wed May 12, 2010 12:13 am

Hmm is this the Rat?

txraddoc
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Mon Apr 12, 2010 3:17 am
Reputation: 0
Gender: None specified

Postby txraddoc » Thu May 13, 2010 4:53 am

Hey newschool,

I am looking for an EA which trails open orders, places the first stop loss at X number of pips out of profit then moves stop loss closer to the current price in away such when the price moves Y number of pips, then the EA would move the stop loss X number of pips closer to the price. eg when a rpice drops 5 pips, lower the stop loss by 6 pips. Or any other combination.

As an example, I place a manual trade then the EA automatically sets my stop loss X number of pipis away from my transaction price.

As the price moves, I'd like the EA to move to stop loss closer by X number of pips toward the price.

So basically, the farther I am in profit, the tighter my stop loss.

Then the ea would lock in a final stop lose when it gets close to the price. Probably about twenty pips. But it would be nice to have a variable for that final stop loss number.

The only other variable I can think of is to set the lot sizes to bought or sold.

User avatar
forexbob
rank: 150+ posts
rank: 150+ posts
Posts: 275
Joined: Mon Apr 20, 2009 9:52 am
Reputation: 31
Location: Planet Earth
Gender: None specified

Postby forexbob » Thu May 13, 2010 9:27 am

txraddoc wrote:Hey newschool,

I am looking for an EA which trails open orders, places the first stop loss at X number of pips out of profit then moves stop loss closer to the current price in away such when the price moves Y number of pips, then the EA would move the stop loss X number of pips closer to the price. eg when a rpice drops 5 pips, lower the stop loss by 6 pips. Or any other combination.

As an example, I place a manual trade then the EA automatically sets my stop loss X number of pipis away from my transaction price.

As the price moves, I'd like the EA to move to stop loss closer by X number of pips toward the price.

So basically, the farther I am in profit, the tighter my stop loss.

Then the ea would lock in a final stop lose when it gets close to the price. Probably about twenty pips. But it would be nice to have a variable for that final stop loss number.

The only other variable I can think of is to set the lot sizes to bought or sold.


have also a look at Multi-purpose trade management ea
from steve hopwood .
http://www.forexfactory.com/showthread.php?t=89371

probably does not all you want , but goes far.
code is structured and easily adapted
The highest Forex rebates: http://www.cashbackforex.info

txraddoc
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Mon Apr 12, 2010 3:17 am
Reputation: 0
Gender: None specified

Postby txraddoc » Thu May 13, 2010 1:23 pm

Fabulous. Thanks. I'll take a look.

Allen

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

utopianhorizon
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Sun Aug 29, 2010 2:32 am
Reputation: 0
Gender: None specified

Trying to convert a thinkscript to mql4

Postby utopianhorizon » Sun Aug 29, 2010 2:55 am

I have not had any luck converting a thinkscript code to mql4 and was hoping you may be able to help. The EA I would like to create looks like this in thinkscript. Perhaps you can decipher it and create an EA for it.

declare LONG_Entry

input length = 20;
input num_devs_dn=2;
input bollinger_price=close
input lower_band_price=close

def value = Average(bollinger_price, length) - num_devs_dn * stdev(bollinger_price), length);

def crosses_over = lower_band_price>value and lower_band_price[1] <= value[1];

def condition = crosses_over;

addOrder(condition, Max(open,value));


declare Short_Entry;

input length = 20
input num_devs_up=2
input bollinger_price=close
input upper_band_price=close

def value = Average(bollinger_prie, length) + num_devs_up * stdev(bollinger_price, length);

def crosses_under = upper_band_price < value && upper_band_price[1] >= value[1];

def condition = crosses_under && low <=value;
addOrder (condition,Min(open,value));

User avatar
newschool
rank: 150+ posts
rank: 150+ posts
Posts: 489
Joined: Fri Aug 21, 2009 2:26 am
Reputation: 1
Gender: Male

Postby newschool » Sun Aug 29, 2010 8:17 pm

hehehe bollinger price b/o strategy... already done, tested, and put in the archives for no further use ;)

utopianhorizon
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Sun Aug 29, 2010 2:32 am
Reputation: 0
Gender: None specified

Postby utopianhorizon » Sun Aug 29, 2010 9:53 pm

Any chance of getting the code for what I posted earlier? I would be interested in testing it as well. Thanks for any help!

farizu
rank: <50 posts
rank: <50 posts
Posts: 14
Joined: Mon Apr 13, 2009 8:18 pm
Reputation: 0
Gender: None specified

Postby farizu » Fri Sep 10, 2010 11:52 pm

Hey newschool,

Any chance of you kindly using this attached indicator to filter the trades triggerred by the multi ema ea that you coded for me some time back.

This additional indicator i think would filter out many of the unprofitable trades under my older criteria.

use of the attached indicator is selfexplanatory, down arrow for short and up arrow for long.

Many thanks!
Attachments
aBB.mq4
(5.01 KiB) Downloaded 277 times

jaxsterjoe
rank: <50 posts
rank: <50 posts
Posts: 6
Joined: Thu Sep 17, 2009 12:34 pm
Reputation: 0
Gender: None specified

Awesome Oscillator alert

Postby jaxsterjoe » Wed Sep 22, 2010 2:20 pm

newschool, I don't need an EA created, but an indicator. Could you create an indicator that shows a popup alert when the Awesome Oscillator crosses over the zero line and closes positive (green) and also when it crosses over the zero line and closes negative (red)? The sound of the alert I would like the indicator to use the sound I use for an alert in my Metatrader platform. Thank you.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “MetaTrader”