Need advise on this code
-
fxcba
- Trader
- Posts: 46
- Joined: Wed Aug 21, 2013 10:10 pm
Need advise on this code
Ok, here is
You do not have the required permissions to view the files attached to this post.
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Need advise on this code
here you go, now the magicnumber calculation code should work too.. Cheersfxcba » Sat Jul 26, 2014 3:32 pm wrote:Ok, here is
Tommaso
You do not have the required permissions to view the files attached to this post.
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
fxcba
- Trader
- Posts: 46
- Joined: Wed Aug 21, 2013 10:10 pm
Need advise on this code
Hey Tommaso, so all problem was the capital "m"? (I need to pay more atention
)
Thank you
Thank you
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Need advise on this code
there were some minor thingies, like missing brackets, redefining a global variable and line 874 was incomplete..fxcba » Sat Jul 26, 2014 4:02 pm wrote:Hey Tommaso, so all problem was the capital "m"? (I need to pay more atention)
Thank you
Cheers
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
fxcba
- Trader
- Posts: 46
- Joined: Wed Aug 21, 2013 10:10 pm
Need advise on this code
yes, that was me doing trial and error untill I commented allmilanese » Sat Jul 26, 2014 1:18 pm wrote: there were some minor thingies, like missing brackets, redefining a global variable and line 874 was incomplete..
Cheers
Tommaso
but I see that "MagicNumber" now is "magic_number", and "int isymbol=" is "int isymbol =0", so I think there were the main issue.
thank you again
cheers
-
fxcba
- Trader
- Posts: 46
- Joined: Wed Aug 21, 2013 10:10 pm
Need advise on this code
Hello, It's me again
. Today I want to ask a couple of questions
I'm working on "iHigh" and "iLow" function and how it works, this line:
HiPrice = MathMax(HiPrice,iHigh(NULL,PERIOD_CURRENT,shift+1));
makes the EA jumps in trade when price equals previous high, so, first question, what should be written to add a buffer in order to wait price exceed some pips the high?
second question: there is also a several types of periods to choose instead "PERIOD_CURRENT", like "PERIOD_H2", in this case I asume Empty4 will read the high of the last 2 hours, Am I right?, taking this in acount my question is standard Empty4 charts starts at 0 h and ends 23:59 how to make script starts at 0 h reading 12 blocks of 2 hs, stop at 23hs and start again?
Regards and thank you in advance
I'm working on "iHigh" and "iLow" function and how it works, this line:
HiPrice = MathMax(HiPrice,iHigh(NULL,PERIOD_CURRENT,shift+1));
makes the EA jumps in trade when price equals previous high, so, first question, what should be written to add a buffer in order to wait price exceed some pips the high?
second question: there is also a several types of periods to choose instead "PERIOD_CURRENT", like "PERIOD_H2", in this case I asume Empty4 will read the high of the last 2 hours, Am I right?, taking this in acount my question is standard Empty4 charts starts at 0 h and ends 23:59 how to make script starts at 0 h reading 12 blocks of 2 hs, stop at 23hs and start again?
Regards and thank you in advance
- 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
Declare a buffer that you can show as an extern or hard code to your chosen value:Hello, It's me again. Today I want to ask a couple of questions
I'm working on "iHigh" and "iLow" function and how it works, this line:
HiPrice = MathMax(HiPrice,iHigh(NULL,PERIOD_CURRENT,shift+1));
makes the EA jumps in trade when price equals previous high, so, first question, what should be written to add a buffer in order to wait price exceed some pips the high?
Code: Select all
double BufferPips = 10;
HiPrice = MathMax(HiPrice,iHigh(NULL,PERIOD_CURRENT,shift+1));
HiPrice+= (BufferPips * Point);Code: Select all
HiPrice+= (BufferPips / factor);Over to someone else for that one.second question: there is also a several types of periods to choose instead "PERIOD_CURRENT", like "PERIOD_H2", in this case I asume Empty4 will read the high of the last 2 hours, Am I right?, taking this in acount my question is standard Empty4 charts starts at 0 h and ends 23:59 how to make script starts at 0 h reading 12 blocks of 2 hs, stop at 23hs and start again?
Regards and thank you in advance
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.
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
Hello Steve, thank you for your answer.
Regarding second question I've be reading some ea's code and I think this can be done with a start day and hour I'll keep searching
cheers
Regarding second question I've be reading some ea's code and I think this can be done with a start day and hour I'll keep searching
cheers
-
fxcba
- Trader
- Posts: 46
- Joined: Wed Aug 21, 2013 10:10 pm
Need advise on this code
Thank you again, it's working fine
, next week I'll do some forward test to see how Empty4 counts the hours starting on monday at 0 hs.
Where can I find some info about closing the trade on opposite signal?, so far this ea trades one direction untill takes profit or is stopped.
Sorry for ask this way but I only devote a couple of hours a week to coding, so I'm trying to save some research time.
Thank you
Where can I find some info about closing the trade on opposite signal?, so far this ea trades one direction untill takes profit or is stopped.
Sorry for ask this way but I only devote a couple of hours a week to coding, so I'm trying to save some research time.
Thank you
- 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
Download one of my shells from http://www.stevehopwoodforex.com/phpBB3 ... ?f=15&t=79.fxcba » Fri Sep 12, 2014 3:15 pm wrote: Where can I find some info about closing the trade on opposite signal?, so far this ea trades one direction untill takes profit or is stopped.
Go to void CountOpenTrades() and see how the function builds up a picture of trades belonging to the ea. Find this line of code:
TradeWasClosed=LookForTradeClosure(OrderTicket()); to see how the closure function is called and what to do with the loop in the event of a trade being closed.
Then look at bool LookForTradeClosure(int ticket) and see how you can set CloseThisTrade to true if your system has generated an opposite direction signal.
I am not saying this is the only way, or even the best way to do this. I can say that it has worked time and time and time again for me.
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.
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.