hi there
i am new to mql4 i wrote this simple expert the idea is i want to see if candle close price is above kijen sen i want to generate a buy order but cant generate any orders in strategy tester
anyone can give clue here thanks for your time
void OnTick()
{
double kijun_sen=iIchimoku(NULL,0,9,kj,52,MODE_KIJUNSEN,0);
if(Close[1]>kijun_sen)
{OrderSend(Symbol(), OP_BUY, 0.01, Ask, 10*10, 10, 10, "My 1st Order!");}
}
The SL and TP need to be at the actual price rather than pips
The SL and TP need to be at the actual price rather than pips
i updated the code to relay on bid price still nothing
extern double kj=52;
extern double StopLoss=10;
extern double TakeProfit=10;
void OnTick()
{
double kijun_sen=iIchimoku(NULL,0,9,kj,52,MODE_KIJUNSEN,0);
if(Close[1]>kijun_sen)
{OrderSend(Symbol(), OP_BUY, 0.01, Ask, 10*10, Bid-StopLoss*Point, Bid+TakeProfit*Point, "My 1st Order!");}
}
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
Please edit your posts and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
- 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 there
i am new to mql4 i wrote this simple expert the idea is i want to see if candle close price is above kijen sen i want to generate a buy order but cant generate any orders in strategy tester
anyone can give clue here thanks for your time