Programmazione Metatrader aiuto per semplice TS MQL4 (1 Viewer)

goldor

Nuovo forumer
Buongiorno a tutti!! Essendo un neofito a tutti gli effetti, chiedo cortesemente un aiuto: mi servirebbe di programmare un semplice trading system in mql4, che tutti i giorni, ad un orario stabilito, metta a mercato una posizione long o short con un trailing-stop inserito; ho provato a fare delle bozze, però mi vengono restituiti una serie di errori che non riesco a correggere. :mmmm: Qualcuno potrebbe gentilmente aiutarmi? Ne metto una di queste in sell:

#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict

extern int MagicNumber = 123321;
extern bool EachTickMode = True;
extern double Lots = 0.1;
extern int Slippage = 2;
extern int StopLoss = 300;
extern int TakeProfit = 0;
extern int TrailingStop = 300;
extern int FromHourTrade = 9;
extern int ToHourTrade = 9
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int Init()
{
//---

opensell();

//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---

}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---

}
//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
const long &lparam,
const double &dparam,
const string &sparam)
{
//---

}
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| ChartEvent function |
//+------------------------------------------------------------------+
void opensell()

ordersend(Symbol(), OP_SELLSTOP, lots, UseHourTrade, Bid+stoploss*Point, Bid-takeprofit*point, "Sell Trade", );
 

Users who are viewing this thread

Alto