Need advise on this code

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.

Need advise on this code

Post by SteveHopwood »

fxcba » Wed Oct 15, 2014 6:06 pm wrote: 4º- the pending orders have to be at certain distance from high and low of previuos hour candle (fail)

Code: Select all

double PendingBufferPips = 10;//Declare this somewhere you can find it easily so you can play around with the buffer
double BuyStopPrice = iHigh(Symbol(), PERIOD_H1, 1) + (PendingBufferPips * Point);
Or, if you have had the sense to come to grips with and use Paul's pip factor code from my shells:

Code: Select all

double PendingBufferPips = 10;//Declare this somewhere you can find it easily so you can play around with the buffer
double BuyStopPrice = iHigh(Symbol(), PERIOD_H1, 1) + (PendingBufferPips / factor);
Great to see you making progress. :clap:

: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.
Lowphat
Trader
Posts: 121
Joined: Fri Jun 27, 2014 12:20 am

Need advise on this code

Post by Lowphat »

iHigh always reruns 0 for me, is there something you have to do or am i bugged?
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.

Need advise on this code

Post by SteveHopwood »

Lowphat » Wed Oct 15, 2014 10:48 pm wrote:iHigh always reruns 0 for me, is there something you have to do or am i bugged?
Don't know. Not a mind reader. No idea what you have coded. How could I?

: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.
Lowphat
Trader
Posts: 121
Joined: Fri Jun 27, 2014 12:20 am

Need advise on this code

Post by Lowphat »

SteveHopwood » Wed Oct 15, 2014 4:51 pm wrote:
Lowphat » Wed Oct 15, 2014 10:48 pm wrote:iHigh always reruns 0 for me, is there something you have to do or am i bugged?
Don't know. Not a mind reader. No idea what you have coded. How could I?

:xm:
what i mean is iLow(NULL,PERIOD_H1,1) <-- will always return 0 for me even if its the only code in the start loop.

I will figure it out though thx for the reply.
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.

Need advise on this code

Post by SteveHopwood »

Lowphat » Wed Oct 15, 2014 11:14 pm wrote:
SteveHopwood » Wed Oct 15, 2014 4:51 pm wrote:
Lowphat » Wed Oct 15, 2014 10:48 pm wrote:iHigh always reruns 0 for me, is there something you have to do or am i bugged?
Don't know. Not a mind reader. No idea what you have coded. How could I?

:xm:
what i mean is iLow(NULL,PERIOD_H1,1) <-- will always return 0 for me even if its the only code in the start loop.

I will figure it out though thx for the reply.
Make sure you are calling iLow with a double i.e.
double CandleLow = iLow(NULL,PERIOD_H1,1);

These days, I do not trust NULL, and so always make the call
double CandleLow = iLow(Symbol(),PERIOD_H1,1);

If that doesn't work then you are stuffed. Delete the platform and reinstall it somewhere else. Always somewhere else to make sure you are not merely reinstalling on top of rubbish that is not removed by the reinstalation.

: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.
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

SteveHopwood » Wed Oct 15, 2014 7:15 pm wrote:
fxcba » Wed Oct 15, 2014 6:06 pm wrote: 4º- the pending orders have to be at certain distance from high and low of previuos hour candle (fail)

Code: Select all

double PendingBufferPips = 10;//Declare this somewhere you can find it easily so you can play around with the buffer
double BuyStopPrice = iHigh(Symbol(), PERIOD_H1, 1) + (PendingBufferPips * Point);
Or, if you have had the sense to come to grips with and use Paul's pip factor code from my shells:

Code: Select all

double PendingBufferPips = 10;//Declare this somewhere you can find it easily so you can play around with the buffer
double BuyStopPrice = iHigh(Symbol(), PERIOD_H1, 1) + (PendingBufferPips / factor);
Great to see you making progress. :clap:

:xm:
Thank you Steve :good:, I'll get down to work.
Cheers and have a nice day
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

Hello, sorry if this is a noob question
I want to know if an EA can withdraw a not filled pending order made by itself when an opossite signal appears, is it possible to achieve?
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

Need advise on this code

Post by renexxxx »

fxcba » Sat Mar 14, 2015 9:10 am wrote:Hello, sorry if this is a noob question
I want to know if an EA can withdraw a not filled pending order made by itself when an opossite signal appears, is it possible to achieve?
Yes, the function to use is OrderDelete(), with the ticket number of the pending order.
fxcba
Trader
Posts: 46
Joined: Wed Aug 21, 2013 10:10 pm

Need advise on this code

Post by fxcba »

Thank you very much renexxxx.
Post Reply

Return to “Coders Hangout”