Hi
Im having some difficulty with coding a multi stage acceptance to open a trade and I hoping someone can help
there are 4 indicators that need to return true values to open a code. Im trying to expand this to add a 5th and 6th indicator combination to reduce drawdown.
what im tring to achive is:
If the first set of criteria are true, loop for X bars until either the second group of criteria is true or abandon the trade
Here is what i have so far
Part of OnBar()
then the entrySignal
im sure there needs to be a counter add but does it go to the onbar()
Thanks in advance
Its not entirely clear what you want, but I guess it is something like this pseudo code:
// If the first set of criteria are true, loop for X bars until either the second group of criteria is true or abandon the trade if(first_set_of_criteria == true) { X = 0; do { if(second_group_of_criteria == true) { //whatever you want to do return(true); } X = (bar_has_changed)? X++ : X; } // end - do while(X < bar_limit); return(false); //abandon trade } //end if
Hi R4tna C,
Thanks for that. I think that is what im after. I will have a go with that. Much appreciated
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
Im having some difficulty with coding a multi stage acceptance to open a trade and I hoping someone can help
there are 4 indicators that need to return true values to open a code. Im trying to expand this to add a 5th and 6th indicator combination to reduce drawdown.
what im tring to achive is:
If the first set of criteria are true, loop for X bars until either the second group of criteria is true or abandon the trade
Here is what i have so far
Part of OnBar()
then the entrySignal
im sure there needs to be a counter add but does it go to the onbar()
Thanks in advance