Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 04:25:58 +0000



MySCDateTime.GetDayOfWeek() ERROR

View Count: 1028

[2018-11-01 19:14:54]
User114959 - Posts: 10
Hello,

When using this function, the date returned is not correct. This is occurring in the Simulated version while testing the custom function.
Not sure if the simulated feed has the current day of the week. The day returned is off by a couple of days.

Having to update the variable manually each day due to this issue while testing.

Please advise.

  SCDateTime MySCDateTime;

  if (MySCDateTime.GetDayOfWeek() == MONDAY)
  {
    Based on if the day is Monday set a variable;
  }

Thank you.
[2018-11-01 20:14:50]
Sierra Chart Engineering - Posts: 104368
Tell us the value you see in MySCDateTime when you think it should be a Monday and we will verify if it is a Monday or not.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-11-01 21:12:26]
User114959 - Posts: 10
Hello,

I made a quick change to the code to display the numeric value of the day being pulled from the system.
Just for testing this issue...

Shown below:

  if (MySCDateTime.GetDayOfWeek() == THURSDAY)
  {
    DayOfWeek = 4.00;
  }
  if (MySCDateTime.GetDayOfWeek() == FRIDAY)
  {
    DayOfWeek = 5.00;
  {
  if (MySCDateTime.GetDayOfWeek() == SATURDAY)
  {
    DayOfWeek = 6.00;
  }
  if (MySCDateTime.GetDayOfWeek() == SUNDAY)
  {
    DayOfWeek = 7.00;
  }


The value on the chart is: 6.00

So the day being pulled is Saturday.

See attached screen shot of my Chart.
image2018-11-01_14-07-36.png / V - Attached On 2018-11-01 21:10:47 UTC - Size: 8.14 KB - 245 views
[2018-11-01 21:14:34]
Sierra Chart Engineering - Posts: 104368
But the question is what is actually contained with in MySCDateTime, without using the get day of week function.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-11-01 21:22:13]
User114959 - Posts: 10
Give me an example of how I would display that value on the chart. Want to make sure I am understanding your request.
[2018-11-02 18:47:49]
Sierra Chart Engineering - Posts: 104368
Refer to the documentation here for this:
ACSIL Programming Concepts: Debug Logging
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-11-02 19:06:24]
User114959 - Posts: 10
Hello,

Thank you for the example.

The log is capturing the correct date.

DateTime=junk characters|2018-11-02 12:05:33


So the date is correct. So not sure why the GetDayofWeek function is not returning the correct day.
[2018-11-02 19:24:54]
User114959 - Posts: 10
Hello,

The information and example you sent got me thinking.

So I changed the line of code

  SCDateTime MySCDateTime;

To

  SCDateTime MySCDateTime = sc.BaseDateTimeIn[sc.Index];


The logic is now returning the correct day of the week.

Issue resolved.

Thank you for your quick responses and assistance.
[2018-11-02 23:49:18]
Sierra Chart Engineering - Posts: 104368
Okay good, but in regards to this:
DateTime=junk characters

If there is indeed invalid characters, we know why and we will fix the example.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-11-05 16:17:27]
User114959 - Posts: 10
Hello,

Yes there were unreadable characters. Thank you for looking into this.


One more thing. When placing a Stop Limit order like the one shown in the attachment, if the price action starts automatically contracting the chart price, the order does not move and causes an entry at a higher price. This is not good.

For example: Chart shows each whole price on the ES (2715.00, 2716.00, 2717.00, etc), but then the price action starts moving up and the chart contracts only showing 2714.00, 2716.00, 2718.00, etc.
This is causing my orders to remain in the same place on the chart after the contraction and an entry at a 1pt higher price.

Is there a setting that I can use to prevent the Chart from contracting automatically? I cannot have the chart automatically contracting when placing an order.

Thank you.
image2018-11-05_8-09-56.png / V - Attached On 2018-11-05 16:17:22 UTC - Size: 20.88 KB - 236 views
[2018-11-05 18:04:41]
Sierra Chart Engineering - Posts: 104368
if the price action starts automatically contracting the chart price, the order does not move and causes an entry at a higher price.
Why would an order move?

There are different methods of scaling you can use. Refer to:
Chart Scale and Scale Adjusting: Scale Range (Scale Settings)
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-11-05 18:04:56
[2018-11-05 18:11:15]
User114959 - Posts: 10
Hello,

I misstated the issue.

When the price action automatically contracts the chart price as mentioned previously, the order MOVES causing an entry at a higher price. In the example given, the order was executed 1pt higher than the original order entry. This only happened when the chart contracted.
[2018-11-06 01:28:38]
Sierra Chart Engineering - Posts: 104368
You mean the scale is changing causing the intended selected price to be different?
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-11-06 01:28:50
[2018-11-06 03:19:02]
User114959 - Posts: 10
Correct.

The order was placed in advance, waiting for price to come to the entry limit price. As price moved towards it, the chart contracted and pushed the order up by a point. I tested this in the simulation version and it occurred twice on two separate orders.

To prevent this in the mean time, I've applied the suggestion of locking the scaling so that it does not move.
[2018-11-06 21:20:05]
Sierra Chart Engineering - Posts: 104368
As price moved towards it, the chart contracted and pushed the order up by a point. I tested this in the simulation version and it occurred twice on two separate orders.
With the way you describe this, this cannot possibly be true. Existing order prices do not change based on scale changes of a chart or Trading DOM. We will never believe this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-11-06 21:20:30

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account