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 »

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
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.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Script for placing pending orders

Post by fx800 »

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
Thanks for the explanation.

pete
User avatar
kosmo
Posts: 3
Joined: Wed May 01, 2013 10:08 pm

Re: Script for placing pending orders

Post by kosmo »

SteveHopwood wrote:Here you are Philipp.

CandleShift allows you to use the hi/lo of any candle you choose - defaults to the previous candle.

I knocked these together this morning, so sing out if anything is not quite right.

:D
Steve,

Thank you! This is simply amazing! Exactly what I've been looking for!

Could you just please explain what is the function of CriminalsECN true/false as well as MaxSlippagePips?

I've started a thread determined to find what I'm looking for (http://www.forexfactory.com/showthread.php?t=425406), and I've been very lucky to be directed to your forum. I know how highly respected you are on FF, and it surely is well deserved.


Regards,
Jo
mind over matter
User avatar
kosmo
Posts: 3
Joined: Wed May 01, 2013 10:08 pm

Re: Script for placing pending orders

Post by kosmo »

kosmo wrote:
Could you just please explain what is the function of CriminalsECN true/false as well as MaxSlippagePips?
Steve,

I've found the answers within your forum. Thanks!

I have another question, though. Would it be possible to make the SL/TP and the entry lines movable?
I'd love to be able to adjust the levels just by dragging the lines on the chart.

I've been trying to combine your script with lvoe 1.6.1 EA, but they won't work together (lvoe lines are blinking after moving and so is the respective price in the terminal). I know lvoe is not your creation, but if there's a way around it that you know of, I'd be very grateful for your suggestions.

Best regards,
Jo
mind over matter
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 »

kosmo wrote:
kosmo wrote:
Could you just please explain what is the function of CriminalsECN true/false as well as MaxSlippagePips?
Steve,

I've found the answers within your forum. Thanks!

I have another question, though. Would it be possible to make the SL/TP and the entry lines movable?
I'd love to be able to adjust the levels just by dragging the lines on the chart.

I've been trying to combine your script with lvoe 1.6.1 EA, but they won't work together (lvoe lines are blinking after moving and so is the respective price in the terminal). I know lvoe is not your creation, but if there's a way around it that you know of, I'd be very grateful for your suggestions.

Best regards,
Jo
What lines? The script does not draw any. If id did, it could do nothing with them - it is a script.

: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
kosmo
Posts: 3
Joined: Wed May 01, 2013 10:08 pm

Re: Script for placing pending orders

Post by kosmo »

SteveHopwood wrote: What lines? The script does not draw any. If id did, it could do nothing with them - it is a script.

:D
Steve,

I am not a coder. Please excuse me if the terminology is not right. It might be an EA that I'm after then.

Would it be possible to code one that would:

a/ place pending orders exactly the way your script does (at x pip distance from the last candle's high/low, with preset SL/TP and lot size);
b/ and at the same time draw movable SL/TP/entry lines, so that I could modify price levels from the chart, e.g. drag the SL line to BE

I hope you can help.
Thank you in advance.

Jo
mind over matter
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 »

10.4 Individual Trade Manager will work with any pending trade. http://www.stevehopwoodforex.com/phpBB3 ... =37&t=1492.


:D
kosmo wrote:
SteveHopwood wrote: What lines? The script does not draw any. If id did, it could do nothing with them - it is a script.

:D
Steve,

I am not a coder. Please excuse me if the terminology is not right. It might be an EA that I'm after then.

Would it be possible to code one that would:

a/ place pending orders exactly the way your script does (at x pip distance from the last candle's high/low, with preset SL/TP and lot size);
b/ and at the same time draw movable SL/TP/entry lines, so that I could modify price levels from the chart, e.g. drag the SL line to BE

I hope you can help.
Thank you in advance.

Jo
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:
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
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:
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
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:
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
Post Reply

Return to “Scripts”