Inputs: test(0), test2(0), test3(0);
variables: Pivot(0), R1(0), S1(0), nearness(0), trailing(0), ma_entry_value(0), ma_exit_value(0),stoploss_value(0);
Pivot = (HighD(1) + LowD(1) + CloseD(1))/3;
R1 = 2 * Pivot - LowD(1);
S1 = 2 * Pivot - HighD(1);
nearness = 0.0015;
ma_entry_value = 14;
trailing = 0.0044;
ma_exit_value = 4;
stoploss_value = 0.0050;
If marketposition = 0 and date>=1100505 and entrydate(1) <> date then begin
If lowd(0) < Pivot + nearness and lowd(0) > Pivot - nearness
and lowd(0) < AverageFC(c, ma_entry_value)
Then buy("Long") this Bar;
If highd(0) > Pivot - nearness and highd(0) < Pivot + nearness
and highd(0) > AverageFC(c, ma_entry_value)
Then sell("Short") this Bar;
end;
If c > r1 - trailing and c < AverageFC(c, ma_exit_value) then exitlong ("L trailing exit") this bar;
If c < s1 + trailing and c > AverageFC(c, ma_exit_value) then exitshort ("S trailing exit") this bar;
If openpositionprofit < -stoploss_value then exitlong ("L stoploss") this bar;
If openpositionprofit < -stoploss_value then exitshort ("S stoploss") this bar;
One way around your problem is to do a Direct Sync. with a more reliable Time Server than the ones Windows uses.
The US Atomic Clock IP Address is 132.163.4.102 ,Type this Address in your Internet Time Servers Slot and press the update now button. Windows will keep this address as its default sync. address until you change it. The sync. is always flawless.
Now the default Update Interval for Time Synchronization in Windows is 7 Days.
You can change how frequent Windows Synchronize with the internet time servers with a simple reg. entry.
HKLM_System_CurrentControlSet_servicies_W32Time\Config -------->UpdateInterval----604800
The amount 604800 is the amount of Seconds in 7 days,
You can change the amount to reflect how often your Computer Synchronizes.
Reboot after making the changes.
Another way is to run Task Scheduler to open Date an Time, when Windows Synchronizes Time.
I hope this will be helpful.
nighthunder.//
...Yes, you only need to update the CurrentControlSet key...
ControlSet001 and ControlSet002 are alternating backups of CurrentControlSet, you don't need to update them.
I need precisely 15 minute timeframe data from disktrading because I need to verify if my systems live on IB TWS execute exactly the trades that get backtested by tradestation on disktrading data. I need to see if my systems are doing live what they are supposed to do, to understand if their failure (when it is the case) is due to the system not working anymore or to the fact that it is not executing trades according to the backtests.
Please correct any English mistakes.
Inputs: test(0), test2(0), test3(0);
variables: Pivot(0), R1(0), S1(0), nearness(0), trailing(0), ma_entry_value(0), ma_exit_value(0),stoploss_value(0);
Pivot = (HighD(1) + LowD(1) + CloseD(1))/3;
R1 = 2 * Pivot - LowD(1);
S1 = 2 * Pivot - HighD(1);
nearness = 0.0015;
ma_entry_value = 14;
trailing = 0.0045;
ma_exit_value = 4;
stoploss_value = 0.0050;
If marketposition = 0 and date>=1100505 and entrydate(1) <> date then begin
If lowd(0) < Pivot and lowd(0) > Pivot - nearness
and lowd(0) < AverageFC(c, ma_entry_value)
Then buy("Long") this Bar;
If highd(0) > Pivot and highd(0) < Pivot + nearness
and highd(0) > AverageFC(c, ma_entry_value)
Then sell("Short") this Bar;
end;
If c > r1 - trailing and c < AverageFC(c, ma_exit_value) then exitlong ("L trailing exit") this bar;
If c < s1 + trailing and c > AverageFC(c, ma_exit_value) then exitshort ("S trailing exit") this bar;
If openpositionprofit < -stoploss_value then exitlong ("L stoploss") this bar;
If openpositionprofit < -stoploss_value then exitshort ("S stoploss") this bar;