Script for placing pending orders

User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Script for placing pending orders

Post by SteveHopwood »

sini wrote:
SteveHopwood wrote:
sini wrote:
SteveHopwood wrote:
fx8000 wrote:The sell script is giving rise to error (4107) : invalid price parameter for trade function.

This may be caused by the sell script

price = xxx - SubtractFromLow - xxx, instead of price = xxx - SubtractFromLowPips - xxx,

because the code failed to make a call to extern int SubtractFromLowPips = xxx ?

A typo error ?

The buy script works just fine.

pete
SubtractFromLow is a doubles converter for for the int SubtractFromLowPips , and is set in init(). An integer divided by factor results in zero, which is why the int needs converting.

I present users with integer inputs that the code then converts, so they will enter pips as pips and not be bugged by the x digit bollocks.

:D

Hi Steve,

Why we have a spread calculated in the sell script? We need it only in the buy script. If we want to set up sell stop we need only Subtract form low pips not spread because spread will be calculated on the closing of the trade! For example if low from last candle is 1.3300 we need trade on the 1.3298 (2 pips bellow) but we get trade 2 pips bellow + spread, if spread is two pips our sell will be opened at 1.3296 instead of 1.3298, because of spread calculated in the script, but we know the criminal will take spread on the closing if we are in the sell.

Thank you in advance
Because that is what the op asked for.

:D
Please can you change this?
Thank you
Yep. Later on today.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Script for placing pending orders

Post by SteveHopwood »

I have posted the script in post 2.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
sini
Trader
Posts: 19
Joined: Tue Jan 03, 2012 11:24 am

Re: Script for placing pending orders

Post by sini »

SteveHopwood wrote:I have posted the script in post 2.

:D
Hi,

Thank you, but now it opens exactly on the low of the previous candle, there is no spread but there is no 2 pips in Subtract from low pips on the last candle low. For example if low from last candle is 1.3300 we need trade on the 1.3298 (2 pips bellow) but we get trade exactly on 1.3300, please can you fix this.

Thank you in advance
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Script for placing pending orders

Post by SteveHopwood »

Done. Post 2.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
sini
Trader
Posts: 19
Joined: Tue Jan 03, 2012 11:24 am

Re: Script for placing pending orders

Post by sini »

SteveHopwood wrote:Done. Post 2.

:D

Thank you very much Steve. :D
Ianski
Posts: 4
Joined: Thu Apr 03, 2014 6:16 pm

Script for placing pending orders

Post by Ianski »

Hello everyone, I'm new to the Empty4 platform after trading on broker Web platforms for a while and found this site a couple of days ago while looking for a script/EA that places orders on the high/low of previous candles.
This script is almost exactly what I have been looking for. To be able to drag and drop a script onto a chart at 06.00 when I can barely see through the haze of early morning rise brain and eye freeze is fantastic. I love the candle shift element - this is just brilliant. I say almost because what would make this really useful is a breakeven point, jumping stop loss so that you can take advantage of the trade at say 30 or whatever PIP increments I see fit as it progresses without finding that the price went to +5000 PIP's ( exaggeration ) and then retraced to +10 PIP's or even worse taken out by the SL for a losing trade. It would almost be like finding out that you could have paid off the mortgage only to find that your earning would only take care of the toilet roll bill. Steve Hopwood, or anyone have you made any adjustments to this script to include these additional settings ? It would be fantastiche if you have.
Cheers for now
Ianski P
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Script for placing pending orders

Post by SteveHopwood »

Ianski » Tue Apr 08, 2014 1:12 pm wrote:Hello everyone, I'm new to the Empty4 platform after trading on broker Web platforms for a while and found this site a couple of days ago while looking for a script/EA that places orders on the high/low of previous candles.
This script is almost exactly what I have been looking for. To be able to drag and drop a script onto a chart at 06.00 when I can barely see through the haze of early morning rise brain and eye freeze is fantastic. I love the candle shift element - this is just brilliant. I say almost because what would make this really useful is a breakeven point, jumping stop loss so that you can take advantage of the trade at say 30 or whatever PIP increments I see fit as it progresses without finding that the price went to +5000 PIP's ( exaggeration ) and then retraced to +10 PIP's or even worse taken out by the SL for a losing trade. It would almost be like finding out that you could have paid off the mortgage only to find that your earning would only take care of the toilet roll bill. Steve Hopwood, or anyone have you made any adjustments to this script to include these additional settings ? It would be fantastiche if you have.
Cheers for now
Ianski P
http://www.stevehopwoodforex.com/phpBB3 ... ?f=21&t=64

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Ianski
Posts: 4
Joined: Thu Apr 03, 2014 6:16 pm

Script for placing pending orders

Post by Ianski »

Nice one Mr Hopwood, I will have a play with this over the next few days on a demo account. There's a lot of setting so I may be at this for a while.

Cheers for now
Ianski
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Script for placing pending orders

Post by SteveHopwood »

Ianski » Wed Apr 09, 2014 5:47 pm wrote:Nice one Mr Hopwood, I will have a play with this over the next few days on a demo account. There's a lot of setting so I may be at this for a while.
Yes, you will.

Ask question in the mptm thread. I will not answer them because I produced a user guide specifically so I would not have to do so, but there is always a kindly soul wandering by with more patience than me.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Ianski
Posts: 4
Joined: Thu Apr 03, 2014 6:16 pm

Script for placing pending orders

Post by Ianski »

No problem, I downloaded the pdf so I should be ok. I like to demo things anyway rather than ask, that way I learn faster. I'm only about 15 minutes from your house anyway as I live on the East side of Sheffield should I get stuck ..... of course I'm only joking, its probably more like 20 mins.
Post Reply

Return to “Scripts”