i cant generate order

 

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

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!");} 

  }
 
mo798ua:

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

 
iRick:

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!");} 

  }

 
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
 
William Roeder:
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
updated now will you please can you help 
Reason: