Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Need help with Alert Code Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
biseniusr
Posted : Sunday, April 25, 2010 2:23:36 PM
Registered User
Joined: 9/2/2006
Posts: 12

This works as expected when used as a scan and chart condition MyCondition is hard coded

'# MC = chartCondition.MyCondition

If Me.isLastBar AndAlso MC.value Then
    pass
    Me.ShowMessage(" MC Buy " & Me.currentsymbol & " Tomarrow At " & (price.High + .125)& " Limit" )
   
End If

How can I create an Alert as a condition that I can drag any combo Condition onto and get the alert without the need to hard code each one.

Also how can i use (price.High + .125) and limit the number of decimal places to two.

Thanks
jas0501
Posted : Sunday, April 25, 2010 4:25:13 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
QUOTE (biseniusr)


Also how can i use (price.High + .125) and limit the number of decimal places to two.

Thanks


dim entryPrice as single

If Me.isLastBar AndAlso MC.value Then
    pass
  entryPrice = price.High + 0.125
    Me.ShowMessage(" MC Buy " & _
            Me.currentsymbol & _
            " Tomorrow At " & _
            entryPrice.tostring("0.00")  & " Limit" ) 
End If
biseniusr
Posted : Monday, April 26, 2010 4:26:43 PM
Registered User
Joined: 9/2/2006
Posts: 12
Thanks works as expected, is it possable to write a universal alert that any condition and can be dragged on to.
jas0501
Posted : Monday, April 26, 2010 7:06:56 PM
Registered User
Joined: 12/31/2005
Posts: 2,499
If I'm understanding your question this code will work fine.  Just drag the condition of choice and then change the name to SomeCondition

'# SomeCondition = chartCondition.WhateverConditionYouDrag

dim entryPrice as single

If Me.isLastBar AndAlso SomeCondition.value Then
    pass
  entryPrice = price.High + 0.125
    Me.ShowMessage(" MC Buy " & _
            Me.currentsymbol & _
            " Tomorrow At " & _
            entryPrice.tostring("0.00")  & " Limit" ) 
End If
biseniusr
Posted : Tuesday, April 27, 2010 8:35:33 PM
Registered User
Joined: 9/2/2006
Posts: 12
Thanks for the guidance works great
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.