比如在图表上画一条水平线然后系统判断所处位置自动挂单,如果移动线的位置挂单的价格也会跟着改变。
如果订单盈利后只要移动线就能移动止损和止赢!
#property copyright
#property link ""
string _verName="LOCLinePips";
string _ver="v2.0";
extern color _textColor=Lime;
extern int _sleepTimeMS=50;
bool _isRunning=false;
string _fullName;
string _objPref="LOCLinePips";
int start()
{
_fullName=_verName+" "+_ver;
Print("LandOfCash.net "+_fullName+" Started.");
Comment("LandOfCash.net "+_fullName);
if(!_isRunning){
Iterate();
}
DeleteLabels(_objPref);
return (0);
}
void DoJob(){
int obj_total=ObjectsTotal();
string name;
DeleteLabels(_objPref);
for(int i=0;i
{
name=ObjectName(i);
if(ObjectType(name)==OBJ_HLINE){
double price = ObjectGet(name, OBJPROP_PRICE1) ;
CreateText(_objPref+name,Time[0],price,_textColor,DoubleToStr(MathAbs((Bid-price)/Point),0));
}
}
}
void Iterate() {
_isRunning=true;
while(!IsStopped())
{
RefreshRates();
DoJob();
Sleep(_sleepTimeMS);
}
}
void CreateText(string name, datetime time1, double price,color boxcolor, string text){
ObjectDelete(name);
if(!ObjectCreate(name, OBJ_TEXT,0, time1, price))
{
Print("error: cant create OBJ_TEXT! code #",GetLastError());
return(0);
}
ObjectSetText(name, text, 7, "Verdana", boxcolor);
}
void DeleteLabels(string objPref){
int obj_total=ObjectsTotal();
string name;
for(int i=0;i
{
name=ObjectName(i);
if(StringFind(name, objPref,0)>-1){
ObjectDelete(name);
i--;
}
}
}
//+------------------------------------------------------------------+
兴业投资 Copyright© 2018 ——澳汇外汇 ——Doo Prime(德璞资本)官网 ——Outrade跟单社区 ——外汇平台