#include int rsi_handle; CTrade trade; //breakout price is addition of range price plus 100 pips //today trend prices as permarket double buy_trend_price = 1.13380; double sell_trend_price = 1.13270; //double breakoutprice = trend_price + 0.00040; ulong tickket; double current_sell; double current_buy; int OnInit() { return (INIT_SUCCEEDED); } void OnDeinit(const int reason) { } void OnTick() { current_sell = SymbolInfoDouble(_Symbol, SYMBOL_BID); current_buy = SymbolInfoDouble(_Symbol, SYMBOL_ASK); // Print("the current breakout price is",breakoutprice); //Print("the current trendt price is",trend_price); //Print("the current sell is",current_sell); //Print("the current buy is",current_buy); //if(current_buy>=breakoutprice){ if(tickket<=0){ //trend_price = current_buy; //buy stop losses and order if(buy_trend_price == current_buy){ double buy_Stoploss; double buy_targetPrice; //profit orstoploss prices buy_Stoploss = buy_trend_price - 0.00020; buy_targetPrice = buy_trend_price + 0.00400; string buy_order_comments = "buy_orderexecuted"; trade.Buy(0.01,_Symbol,buy_trend_price,buy_Stoploss,buy_targetPrice,buy_order_comments); tickket = trade.ResultOrder(); Print("ticket idfor thecurrent buy order is",tickket); Print("the current trendt price for buy is",buy_trend_price); } else if(sell_trend_price == current_sell) { //sell stoplosses and order double sell_Stoploss; double sell_targetPrice; //profit orstoploss prices sell_Stoploss = sell_trend_price + 0.00035; sell_targetPrice = sell_trend_price - 0.00050; string sell_order_comments = "sell_orderexecuted"; //trade.Sell(0.01,_Symbol,sell_trend_price,sell_Stoploss,sell_targetPrice,sell_order_comments); tickket = trade.ResultOrder(); Print("ticket idfor thecurrent buy order is",tickket); Print("the current trendt price for sell is",sell_trend_price); } } }