In the past I've read through many threads, but only now I've decided to request help with a piece of code from the Strategy Wizard.
The code right now is as follows...
{ // Condition set 1 if (Close[0] > Open[0]) { EnterLong(DefaultQuantity, "LongEntry"); ExitShort("ShortExit", "ShortEntry"); } // Condition set 2 if (Close[0] < Open[0]) { EnterShort(DefaultQuantity, "ShortEntry"); ExitLong("LongExit", "LongEntry"); } }
This code will enter a Long trade whenever a green Renko bar is formed, and it will exit a Long trade and enter a Short trade when a red Renko bar is formed, and vice versa.
But what I want it to do is not enter one trade for only one bar, I want the strategy to enter a Long trade for every consecutive green Renko bar that is formed until one single red Renko bar is formed.
Right now it only enters one Long trade whenever one green Renko bar is formed, and it maintains this Long position until the next red Renko bar is formed, even if 10 other green Renko bars are formed.
How would I go about to make it repeat itself like that?
Thank you for your time, looking forward to the replies.
Otis.
Comment