Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 14:02:34 +0000



Post From: Auto Trade ACSIL: how to enter at bar close

[2020-04-21 05:05:54]
Flipper - Posts: 65
If you are using intraday data you can have an order trigger after a time if other conditions are meet. Then make it 30 seconds before the close of day.

for example,

int TradeTime = HMS_TIME(15, 59, 30); // this is 30 seconds before 4:00pm as an example
int BarTime = sc.BaseDateTimeIn[sc.Index].GetTime();


// then in the trading code condition from above example .

if (sc.CrossOver(Last, SimpMovAvgSubgraph) == CROSS_FROM_BOTTOM && BarTime > TradeTime )

{

Result = sc.BuyEntry(NewOrder);

if (Result > 0) //If there has been a successful order entry, then draw an arrow at the low of the bar.

BuyEntrySubgraph[sc.Index] = sc.Low[sc.Index];

}