stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Need advise on this code
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3740
Page 5 of 5
Author:  SteveHopwood [ Wed Oct 15, 2014 10:15 pm ]
Post subject:  Need advise on this code

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:
Author:  Lowphat [ Wed Oct 15, 2014 10:48 pm ]
Post subject:  Need advise on this code

iHigh always reruns 0 for me, is there something you have to do or am i bugged?
Author:  SteveHopwood [ Wed Oct 15, 2014 10:51 pm ]
Post subject:  Need advise on this code

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:
Author:  Lowphat [ Wed Oct 15, 2014 11:14 pm ]
Post subject:  Need advise on this code

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.
Author:  SteveHopwood [ Wed Oct 15, 2014 11:24 pm ]
Post subject:  Need advise on this code

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:
Author:  fxcba [ Thu Oct 16, 2014 11:23 am ]
Post subject:  Need advise on this code

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
Author:  fxcba [ Fri Mar 13, 2015 11:10 pm ]
Post subject:  Need advise on this code

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?
Author:  renexxxx [ Sat Mar 14, 2015 3:16 am ]
Post subject:  Need advise on this code

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.
Author:  fxcba [ Sat Mar 14, 2015 10:48 am ]
Post subject:  Need advise on this code

Thank you very much renexxxx.
All times are UTC Page 5 of 5