FxTrading8565: . Hope so that u know the solution for the situation.
|
angevoyageur:
Yes, it just need to be coded, nothing really difficult.
I will be very thank full if u give me its basic skeleton example
Yes, it just need to be coded, nothing really difficult.
FxTrading8565:
I will be very thank full if u give me its basic skeleton example
What have you tried ?
I will be very thank full if u give me its basic skeleton example
angevoyageur:
What have you tried ?
What have you tried ?
here is my attempt ...
I am trying to count closed position after there is a new box ....
if( box_start != last_box ) // if there is a new box { last_box = box_start ; start_box = iTime(NULL,0,0); // start time of the box } static datetime loct; // last order closed time for(int iPos=OrdersHistoryTotal()-1; iPos >= 0; iPos--) if (OrderSelect(iPos, SELECT_BY_POS, MODE_HISTORY) && OrderType() <=1 && OrderCloseTime() > loct && OrderCloseTime() > start_box ) { count_orders ++ ; // counting the number of trades loct = OrderCloseTime() ; break; } // user define function for checking the number of trades that have been counted bool place_orders() { if( count_orders < 4 ) return(true); else if( count_orders > 4 ) return(false); else return(EMPTY_VALUE); }
&& OrderCloseTime() > loct && OrderCloseTime() > start_box
You want to count how many were opened during the box. Why are you looking for the last closed order?bool place_orders() { if( count_orders < 4 ) return(true); else if( count_orders > 4 ) return(false); else return(EMPTY_VALUE); }
Bool only has true or false. You can't return EMPTY_VALUE
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello Coders ,
This is my first time here on this forum . I needed a little bit help and suggestion from u awesome guys. I am unable to solve this puzzle that how can i set max number of trades . I know that is easy but here a situation is a little bit different . I want to set max number of trades per box . I found an indicator which draws boxes on the screen so i want to set limited number of trades to be placed on the box period . Here is the pic of the
indicator . Hope so that u know the solution for the situation .