Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

convert volume to average volume

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NinjaTrader_PatrickH
    replied
    Hello peterhxu7,

    Thank you for your response.

    I do not beleive I fully understand but I am going to try an example here, let me know if this it what you meant.

    We will take the first five minute volumes, store them in individual doubles and then average those values:
    Code:
    			if(Bars.BarsSinceSession == 5)
    			{
    				vol1 = Volume[4];
    				vol2 = Volume[3];
    				vol3 = Volume[2];
    				vol4 = Volume[1];
    				vol5 = Volume[0];
    				avgVol = (vol1 + vol2 + vol3 + vol4 +vol5)/5;
    			}

    Leave a comment:


  • peterhxu7
    replied
    i would like to convert the firs t five minute volume on 1 minute chart to a fixed normal volume , that way i can change the high volume from the first 5 minute after the martket opens

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello peterhxu7,

    Thank you for the additional information.

    Unfortunately, I do not understand the concept you are going for here. Are you trying to store the first five minutes' volume in a variable and then acquire the average of the volume from those five minutes?

    Leave a comment:


  • peterhxu7
    replied
    not really. i would like to set first 5 minute volume from 9:31am to 9:35am to SMA(Volume, 14)[0]
    something like
    VOL()[0] at 9:31 = SMA(Volume, 14)[0]
    VOL()[0] at 9:32 = SMA(Volume, 14)[0]
    VOL()[0] at 9:33 = SMA(Volume, 14)[0]
    VOL()[0] at 9:34 = SMA(Volume, 14)[0]
    VOL()[0] at 9:35 = SMA(Volume, 14)[0]

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello peterhxu7,

    Thank you for your post.

    Are you looking for a comparison of the first five minutes' volume today against yesterday's first five minutes' volume?

    A basic volume average can be calculated with SMA, for example: SMA(Volume, 14)[0]. This would give you the 14 period moving average of the volume.

    Leave a comment:


  • peterhxu7
    started a topic convert volume to average volume

    convert volume to average volume

    trading es , 1 minute chart. due to the high volume on the first a few minutes, how can i convert the first 5 minute volume into an fixed average 1 minute volume of previous day. need some basic coding

Latest Posts

Collapse

Topics Statistics Last Post
Started by GussJ, 03-04-2020, 03:11 PM
16 responses
3,279 views
0 likes
Last Post Leafcutter  
Started by WHICKED, Today, 12:45 PM
2 responses
19 views
0 likes
Last Post WHICKED
by WHICKED
 
Started by Tim-c, Today, 02:10 PM
1 response
8 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by Taddypole, Today, 02:47 PM
0 responses
5 views
0 likes
Last Post Taddypole  
Started by chbruno, 04-24-2024, 04:10 PM
4 responses
51 views
0 likes
Last Post chbruno
by chbruno
 
Working...
X