Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
hey guys anyone here knows how to shift object to the right/future?
Here's my code:
double Highest = High[iHighest(Symbol(),PERIOD_CURRENT,MODE_HIGH,96,0)];
double Lowest = Low[iLowest(Symbol(),PERIOD_CURRENT,MODE_LOW,96,0)];
int start()
{
ObjectCreate("Rectangle",OBJ_RECTANGLE,0,Time[96],Highest,Time[0],Lowest);
ObjectCreate("TakeProfitLine",OBJ_TREND,0,Time[160],Highest,Time[0],Highest);
ObjectSet("TakeProfitLine",OBJPROP_RAY,false);
return(0);
}
Time[] does not shift object to the right but instead to the left tho :|
im stll learning hehe..
Use Time[], for example Time[0] will giving you a current time. You must have a datetime data specified first.
#define SECONDS_PER_MINUTE 60 int start() { datetime time_now=D'2014.03.05 15:46:00'; datetime time_future= time_now + SECONDS_PER_MINUTE; ObjectCreate("TakeProfitLine",OBJ_TREND,0,Time[160],Highest,time_future,Highest); }
If you put in M1 chart, it will give you trendline shifted 1 bar to the right.
I do not know if it works, but you have the idea to have datetime modified or so.
Use Time[], for example Time[0] will giving you a current time. You must have a datetime data specified first.
If you put in M1 chart, it will give you trendline shifted 1 bar to the right.
I do not know if it works, but you have the idea to have datetime modified or so.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hey guys anyone here knows how to shift object to the right/future?
Here's my code:
double Highest = High[iHighest(Symbol(),PERIOD_CURRENT,MODE_HIGH,96,0)];
double Lowest = Low[iLowest(Symbol(),PERIOD_CURRENT,MODE_LOW,96,0)];
int start()
{
ObjectCreate("Rectangle",OBJ_RECTANGLE,0,Time[96],Highest,Time[0],Lowest);
ObjectCreate("TakeProfitLine",OBJ_TREND,0,Time[160],Highest,Time[0],Highest);
ObjectSet("TakeProfitLine",OBJPROP_RAY,false);
return(0);
}
Time[] does not shift object to the right but instead to the left tho :|
im stll learning hehe..