vaknineyal: cannot understand why is not open order
|
|
OK Thanks,
I saw all my value was 0 and I fix them that because I didn't setup the high low and close, but still not open position.
I think my problem is with for loop is that loop looks OK ?
for (int i=1; i<=20; i++) { if(Close[i] < RL1) { if(High[1] > RL1 && Close[1] < RL1) { int ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,5,0,PivotPoint,NULL,1111111,0,clrNONE); ModifySL(); } } }
Is that OK to check the last 20 candles was under the pivot(RL1) and last one was high above and close below the pivot ?
for (int i=1; i<=20; i++) { if(Close[i] < RL1) { if(High[1] > RL1 && Close[1] < RL1) {
OK Thanks,
I saw all my value was 0 and I fix them that because I didn't setup the high low and close, but still not open position.
I think my problem is with for loop is that loop looks OK ?
Is that OK to check the last 20 candles was under the pivot(RL1) and last one was high above and close below the pivot ?
for (int i=1; i<=20; i++) { if(Close[i] < RL1) { if(High[1] > RL1 && Close[1] < RL1) { int ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,5,0,PivotPoint,NULL,1111111,0,clrNONE); ModifySL(); } } }
Check through you loop and you will see that it does NOT check that the last 20 bars were below the level
It checks the last 20 bars, 1 at a time and if that bar is below the level and the last closed bar meets the condition, the ordersend is called.
This single for loop, could possibly open 20 trades
- 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 guys
I have problem to open order with my expert to open order, what I am trying to do is to check if in the last 20 candle price was under the Resistance Level 1 (calculate by Pivot Points RL1).
After checking the candles I want to see the last candle high was above the RL1 and then close Below RL1, if this happen I want to open short order the TP should be the main Pivot Point and SL should be the same size of PIPS between the open price and the take profit.
Here is my code, Just start to write it and cannot understand why is not open order.
Thanks in advance.
E.