I have a problem with my program.
I'm starting create a program that works with bollinger bands. Here are the functions for open an order:
if (Open>bbMinus && Close<( bbMinus - SpikePips * Point ) && Open<ma) return(true);
if (Open<bbPlus && Close>( bbPlus + SpikePips * Point ) && Open>ma) return(true);
Where SpikePips is a distance (in pips) between bbPlus or bbMinus and the Close.
If one of these functions is true, open a buy or a sell order. No problem to do this, of course.
Now an example: SpikeSell() is true, it opens a sell order. I would like to say the program to store the value of bbPlus at point 0 and then close the order when the current price reaches it. If the order doesn't close in the current bar, it has to store the next value of bbPlus and then try to close the order in the next bar.
Any ideas? Do you think it's a good thing to calculate the distance between Open and bbPlus and then modify the order to take the new profit (the distance between Open and bbPlus)?
I don't know... I'll wait for your help.
Forum on trading, automated trading systems and testing trading strategies
How to Start with Metatrader 5
Simon Gniadkowski, 2013.07.24 10:18
How to post code on this forum . . .