Monday, December 01, 2008     | Register
TradersStudio Forums
Subject: How to pass system info to indicator plot?

You are not authorized to post a reply.   
Author Messages
Optisizer
Posts:4

04-21-2008 4:27 AM Alert 
I would like for my custom indicator in the charts within a session to adjust to the direction of the current open position of the system.
Something along these lines:

If GetMarketPos(0) = +1 Then
    Risk1A = Min(Risk1, Risk1 * AdjustRisk)
Else
If GetMarketPos(0) = -1 Then
    Risk1A = Max(Risk1, Risk1 * AdjustRisk)
Else
    Risk1A = Risk1
End If
End If
Plot1(p0 + Risk1A / ContVal)

In this case, although the GetMarketPos(0) function verifies correctly inside the custom indicator plot, it doesn't seem to recognize any open positions in the corresponding system attached to the same session. Same goes for GetCurrentPosition and GetCurrentSize.

It seems it should be doable to pass system info to a custom indicator plot as there already is a built-in chart equity line function. But how?
murray
Posts:431

04-21-2008 4:37 AM Alert 

The system based functions will not work from indicators. You need to use the Processor API based functions. You can use the market object by using the  thismarket object.

 

' TradersStudio(r) (c) 2005-2007
' Shows how to access Market object from a session
' It uses Thismarket
Sub TS_PlotDrawdown()
Plot1(Thismarket.Equity(BarNumber).Drawdown)
End Sub

You are not authorized to post a reply.
Forums > TradersStudio 2.x > TradersStudio Basic > How to pass system info to indicator plot?



ActiveForums 3.6
TradersStudio® Copyright 2004-2008 All Rights Reserved   |  Privacy Statement  |  Terms Of Use