Mike Medved
-
Posts
1,537 -
Joined
-
Last visited
-
Days Won
123
Content Type
Profiles
Forums
Blogs
Gallery
Downloads
Events
Posts posted by Mike Medved
-
-
Jerry suggested unchecking the Odd Lots setting. What happens when you do?
-
Ok so - are the volumes after 13:07 (that is, the volumes gathered from L1 data by MT) correct but backfill volumes aren't?
If you clear data at that point and re-backfill will the volumes after 13:07 become a lot smaller? -
The question becomes.... What is the CORRECT volume?
-
In Charts/General/Miscellaneous - see if you have "Include Odd Lots" checked or unchecked.
-
-
While optimizing the recalculation of new candles on dynamic updates of charts for OTHER chart types, I screwed up the recalc of the VbP candles.
That was a while ago too You're the first one to notice it. Which means that not many people use them. Too bad - they are nifty.
Fixed it. Jerry will put it up. -
I will run this tomorrow to check.
-
Ok - what should the menu options be?
2 weeks, 1 month, 2 months, 3 months, 6 months, year, all? -
Right. That will be fixed in the next beta.
-
Sure. Instead of PosPaid there, do this:
Pos>0?PosPaid+0.02:PosPaid-0.02or it will also take
IF Pos>0 THEN PosPaid+0.02 ELSE PosPaid-0.02inline conditionals are pretty handy. They can also be stacked - for example if you have no position, you want the price to be Bid? Then you do
Pos>0?PosPaid+0.02:Pos<0?PosPaid-0.02:0 -
Question: does it not modify or does it modify the underlying order (that is, actually sends the modify) but ALSO has a modify yellowish cap on the chart?
-
Yes, that means it's running on 1-min candles, just like having a 1-minute chart and putting that paintbar on it.
As for your question. No, the scan's indicator parameter is not # of minutes, but # of candles...
You can twiddle this a bit. You can have two scans, running on two portfolios (with the same symbols in both portfolios). One scan you would run on 5-min candles, get the KC indicator and store the value in the SetInterVar function. This first scan would not trigger any scan result. In the other scan, you would use GetInterVar to receive that value, and use it as the KC value.
-
Hm the preprocessor that sprinkles indexing [0]s on indexed variables fails in this case.
Try
Timestamp[0].Minute
- 1
-
On 1/8/2024 at 6:49 PM, 3acor said:
the code wouldn't work. I would like to divide the volume by the difference between the current timestamp and the timestamp of the current 15min candle open.
That's what (Timestamp.Minute % 15)+1 gives you. Stick this into a column in a scan and watch it go from 1 to 15 then roll over to 1... Just make sure the scan is run on 15 min candles.
-
18 hours ago, 3acor said:
How can I get the difference between the current timestamp and the timestamp of the candle Open and use it in an equation?
Example: I am using the scanner on the 15min frequency and currently the time is 10:41am. How can I get the difference of 11min which is the Current Timestamp minus the timestamp of the candle Open?
(Timestamp.Minute % 15)+1 ? 1 for 1st minute. 2 for second minute. etc.
-
For that you'd have to keep track of the average yourself. Use StateFIFOQueue of the appropriate size (period), zero it out whenever the new regular session starts (use TradingDay variable - the DayNumber in it changes when the new session starts, and you can figure out if you're in premarket or not as well) and add the candle's volume if regular session. Then take its average.
- 1
-
To add to Jerry's answer - I would prefer to use floor(Pos * 0.75), so that fractionals are not involved.
-
On 12/22/2023 at 5:09 AM, Thebattlefront said:
Mike, So i understand that queue[3] = 2 should work now, but is it also possible to do queue[3]= queue[3] + 2? So I can make a cumulative sum inside only one of its cells.
Also, can i do lets say,
queue[5] = queue[4] / queue[2] or
queue[5] = queue[4] * queue[2]
Is division and multiplication allowed like that? And also, can i do math operations like
queue[10] = Math.Round(queue[4] / queue[2], 2);
Yes, all of those are possible.
-
Ok - you can reference the values in FIFOQueues by using indexing - but the indexing is backwards. That is, [0] is the last value you added. [1] is the one before last. [2] is 2 before last etc.
Assignment of those values - I didn't do before. I put that in, will send you email where to pick up latest exe so you can do queue[3]=2;
-
3 hours ago, Thebattlefront said:
Do you have any idea how I can change the value of a cell in a CurrentState array, by referencing itself and adding another value to it? Or do i have to switch back to individual currentstate variables and abandon the idea of keeping the data stored in a single array altogether?
I remember before you showed me how to use the StateFIFOQueue to add data to a set, and then perform operations on that set (like getting the average) to get the important values i can use. So i know there are alternatives to using just a bunch of individual currentstate variables to hold the values. But I just don't know what those alternatives are.
Yes for what you want (I think) it is best just to use StateFIFOQueue(20) for each of the arrays. You still have to manually save and restore state for each like you're already doing for the one StateFIFOQueue that you have. And you can only store Doubles of course...
-
3 hours ago, Thebattlefront said:
Thanks Mike. Yeah i just want these arrays to store the data from the trades. Much like using individual currentstate variables and labelling them each CurrentState.m_dS1AtrPerBar, CurrentState.m_dS2AtrPerBar, CurrentState.m_dS3AtrPerBar, etc. but using just a single array for all to make it cleaner.
Can i ask , what did you change? My results still look like this:
Edit: The idea here is that each letter represents a different candlestick pattern. And what im doing is tracking the profit / number of trades / winrate of each candlestick, for each stock on my watchlist. That's what all the zeroes and the 1, 2, 3, 4, 5 numbers are in each column. They -should- be tracking the profit, tradecount, etc but i just get a bunch of zeroes.
Look in the save and restore functions. Instead of copying just the structs, I specifically made it copy the arrays...
-
Ok, I just realized something... I should mention it in help file.
A struct that has arrays in it is a mutable struct. Which means that if you just do struct1=struct2, the arrays are not copied. They are there by reference, so both structs would be pointing to the same array.
Let me figure out how to change your code the most elegantly so that this doesn't happen (and that the efficiency does not suffer).
-
I haven't looked yet but here is a detail that may explain what you're seeing:
MT's paintbars are a "state machine". There is a "state", and the new candle changes the "state". The thing is, this state-changing for the new candle may not be called only once per candle. It is for "past" candles, but for the new, latest candle, the "state" is restored to the condition right BEFORE the new candle - then the state-changing code is called for the new, latest candle. Hope this makes sense? -
Please send me the whole paintbar - export it and attach it to an email to support email....
VWAP discrepancy
in Support
Posted
I will dedicate some time to this on Mon... If it's the case that the L1 feed of DXFeed produces candles with different volumes than the DXFeed backfill, will report it to them...
As a reference, what kind of subscription bundle do you have with DXFeed?