How indicator run from iCustom know which period to use? - page 2

 
RaptorUK:

Let me give you an example of why some Indicators do not work correctly in the Strategy Tester . . . .  if you place an Indicator onto a Strategy Tester chart and that Indicator uses Bid it will be the current,  1st Feb 2013,  Bid price that it uses . . . not the Bid price shown on the Strategy Tester chart,  it's very easy to address this issue, instead of using Bid use Close[0]  instead.

Are there other issues like this when trying to use Indicators on Strategy Tester generated chart ?  Yes I'm sure there are. 

Do I know what all these issues are and how to fix them ?  No,  I have come across some,  you should determine what the issues are with your own Indicator and address then. 


I see, is there any way to draw line like indicator does, in EA ? 
 
koskow:

I see, is there any way to draw line like indicator does, in EA ? 
You can use an Indicator . . .  but you have to bear in mind that some things in an Indicator will not work on a ST chart . . .  find them and fix them,  if they can't be fixed then do something different.
 
RaptorUK:
You can use an Indicator . . .  but you have to bear in mind that some things in an Indicator will not work on a ST chart . . .  find them and fix them,  if they can't be fixed then do something different.


I did difrently , as I told you before, when i was using iCustom then indicator was looking on incominng data in EA, but the same attached to the screen saw somehow all information, anyway i am using iCustom and drawing line my self instad of indicato by using ObjectCreate function and now i am sure that values are correct. If i din't notice that, then EA whould show great results, but in real live, there would be pain. 

 

Thanks for your help, i saw you are responding in many posts, probably couse you are moderator, how do you think? is it possible from mathematical point of view, to write EA which will earn constantly ?

 
koskow: I see, is there any way to draw line like indicator does, in EA ? 
I created my Polyline() function for that exact function. So I could verify the EA's values match what the indicator would show.
 
koskow:


Thanks for your help, i saw you are responding in many posts, probably couse you are moderator, how do you think? is it possible from mathematical point of view, to write EA which will earn constantly ?

It was the other way around I think,  I was made a Moderator because I made plenty of posts trying to help . . .  and because I am here most of the time when I am not sleeping  ;-)

If you have a strategy that earns consistently  then yes it can of course can be coded,   IMO discretion is a word used when a trader cannot describe their strategy, so any strategy that has consistency does not involve any kind of "discretion" so can be coded.

 
RaptorUK:

Let me give you an example of why some Indicators do not work correctly in the Strategy Tester...

Are there other issues like this when trying to use Indicators on Strategy Tester generated chart ?  Yes I'm sure there are.

// EA in Strategy Tester
M15::TestExpert::stdlib::onTick()      ---------------------------------
M15::TestExpert::stdlib::onTick()      Predefined variables for "EURUSD"
M15::TestExpert::stdlib::onTick()      ---------------------------------
M15::TestExpert::stdlib::onTick()      Digits  = 5
M15::TestExpert::stdlib::onTick()      Point   = 0.0000'1
M15::TestExpert::stdlib::onTick()      Bid/Ask = 1.2711'2/1.2713'1
M15::TestExpert::stdlib::onTick()      Bars    = 1001
M15::TestExpert::stdlib::onTick()      ---------------------------------
M15::TestExpert::stdlib::onTick()      MarketInfo() for "EURUSD"
M15::TestExpert::stdlib::onTick()      ---------------------------------
M15::TestExpert::stdlib::onTick()      MODE_LOW               = 0.0000'0                 // error: not modelled
M15::TestExpert::stdlib::onTick()      MODE_HIGH              = 0.0000'0                 // error: not modelled
M15::TestExpert::stdlib::onTick()      MODE_TIME              = '2012.11.12 00:00:00'
M15::TestExpert::stdlib::onTick()      MODE_BID               = 1.2711'2
M15::TestExpert::stdlib::onTick()      MODE_ASK               = 1.2713'1
M15::TestExpert::stdlib::onTick()      MODE_POINT             = 0.0000'1
M15::TestExpert::stdlib::onTick()      MODE_DIGITS            = 5
M15::TestExpert::stdlib::onTick()      MODE_SPREAD            = 19
M15::TestExpert::stdlib::onTick()      MODE_STOPLEVEL         = 20
M15::TestExpert::stdlib::onTick()      MODE_LOTSIZE           = 100000
M15::TestExpert::stdlib::onTick()      MODE_TICKVALUE         = 1
M15::TestExpert::stdlib::onTick()      MODE_TICKSIZE          = 0.0000'1
M15::TestExpert::stdlib::onTick()      MODE_SWAPLONG          = -1.3
M15::TestExpert::stdlib::onTick()      MODE_SWAPSHORT         = 0.5
M15::TestExpert::stdlib::onTick()      MODE_STARTING          = 0
M15::TestExpert::stdlib::onTick()      MODE_EXPIRATION        = 0
M15::TestExpert::stdlib::onTick()      MODE_TRADEALLOWED      = 0                        // error: wrongly modelled
M15::TestExpert::stdlib::onTick()      MODE_MINLOT            = 0.01
M15::TestExpert::stdlib::onTick()      MODE_LOTSTEP           = 0.01
M15::TestExpert::stdlib::onTick()      MODE_MAXLOT            = 2
M15::TestExpert::stdlib::onTick()      MODE_SWAPTYPE          = 0
M15::TestExpert::stdlib::onTick()      MODE_PROFITCALCMODE    = 0
M15::TestExpert::stdlib::onTick()      MODE_MARGINCALCMODE    = 0
M15::TestExpert::stdlib::onTick()      MODE_MARGININIT        = 0
M15::TestExpert::stdlib::onTick()      MODE_MARGINMAINTENANCE = 0
M15::TestExpert::stdlib::onTick()      MODE_MARGINHEDGED      = 50000
M15::TestExpert::stdlib::onTick()      MODE_MARGINREQUIRED    = 254.25
M15::TestExpert::stdlib::onTick()      MODE_FREEZELEVEL       = 0

// Indicator in Strategy Tester via iCustom()
H1::TestIndicator::stdlib::onTick()    ---------------------------------
H1::TestIndicator::stdlib::onTick()    Predefined variables for "EURUSD"
H1::TestIndicator::stdlib::onTick()    ---------------------------------
H1::TestIndicator::stdlib::onTick()    Digits  = 5
H1::TestIndicator::stdlib::onTick()    Point   = 0.0000'1
H1::TestIndicator::stdlib::onTick()    Bid/Ask = 1.2711'2/1.2713'1
H1::TestIndicator::stdlib::onTick()    Bars    = 1001
H1::TestIndicator::stdlib::onTick()    ---------------------------------
H1::TestIndicator::stdlib::onTick()    MarketInfo() for "EURUSD"
H1::TestIndicator::stdlib::onTick()    ---------------------------------
H1::TestIndicator::stdlib::onTick()    MODE_LOW               = 0.0000'0                 // error: erroneous value taken from ea environment
H1::TestIndicator::stdlib::onTick()    MODE_HIGH              = 0.0000'0                 // error: erroneous value taken from ea environment
H1::TestIndicator::stdlib::onTick()    MODE_TIME              = '2012.11.12 00:00:00'
H1::TestIndicator::stdlib::onTick()    MODE_BID               = 1.2711'2
H1::TestIndicator::stdlib::onTick()    MODE_ASK               = 1.2713'1
H1::TestIndicator::stdlib::onTick()    MODE_POINT             = 0.0000'1
H1::TestIndicator::stdlib::onTick()    MODE_DIGITS            = 5
H1::TestIndicator::stdlib::onTick()    MODE_SPREAD            = 0                        // error: calculation error
H1::TestIndicator::stdlib::onTick()    MODE_STOPLEVEL         = 20
H1::TestIndicator::stdlib::onTick()    MODE_LOTSIZE           = 100000
H1::TestIndicator::stdlib::onTick()    MODE_TICKVALUE         = 1
H1::TestIndicator::stdlib::onTick()    MODE_TICKSIZE          = 0.0000'1
H1::TestIndicator::stdlib::onTick()    MODE_SWAPLONG          = -1.3
H1::TestIndicator::stdlib::onTick()    MODE_SWAPSHORT         = 0.5
H1::TestIndicator::stdlib::onTick()    MODE_STARTING          = 0
H1::TestIndicator::stdlib::onTick()    MODE_EXPIRATION        = 0
H1::TestIndicator::stdlib::onTick()    MODE_TRADEALLOWED      = 1
H1::TestIndicator::stdlib::onTick()    MODE_MINLOT            = 0.01
H1::TestIndicator::stdlib::onTick()    MODE_LOTSTEP           = 0.01
H1::TestIndicator::stdlib::onTick()    MODE_MAXLOT            = 2
H1::TestIndicator::stdlib::onTick()    MODE_SWAPTYPE          = 0
H1::TestIndicator::stdlib::onTick()    MODE_PROFITCALCMODE    = 0
H1::TestIndicator::stdlib::onTick()    MODE_MARGINCALCMODE    = 0
H1::TestIndicator::stdlib::onTick()    MODE_MARGININIT        = 0
H1::TestIndicator::stdlib::onTick()    MODE_MARGINMAINTENANCE = 0
H1::TestIndicator::stdlib::onTick()    MODE_MARGINHEDGED      = 50000
H1::TestIndicator::stdlib::onTick()    MODE_MARGINREQUIRED    = 259.73                   // error: value taken from online environment
H1::TestIndicator::stdlib::onTick()    MODE_FREEZELEVEL       = 0

// Indicator in Strategy Tester standalone (attached to chart)
M15::TestIndicator::stdlib::onTick()   ---------------------------------
M15::TestIndicator::stdlib::onTick()   Predefined variables for "EURUSD"
M15::TestIndicator::stdlib::onTick()   ---------------------------------
M15::TestIndicator::stdlib::onTick()   Digits  = 5
M15::TestIndicator::stdlib::onTick()   Point   = 0.0000'1
M15::TestIndicator::stdlib::onTick()   Bid/Ask = 1.2983'9/1.2986'7                       // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   Bars    = 1001
M15::TestIndicator::stdlib::onTick()   ---------------------------------
M15::TestIndicator::stdlib::onTick()   MarketInfo() for "EURUSD"
M15::TestIndicator::stdlib::onTick()   ---------------------------------
M15::TestIndicator::stdlib::onTick()   MODE_LOW               = 1.2967'6                 // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_HIGH              = 1.3027'3                 // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_TIME              = '2012.11.30 23:59:52'    // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_BID               = 1.2983'9                 // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_ASK               = 1.2986'7                 // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_POINT             = 0.0000'1
M15::TestIndicator::stdlib::onTick()   MODE_DIGITS            = 5
M15::TestIndicator::stdlib::onTick()   MODE_SPREAD            = 28                       // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_STOPLEVEL         = 20
M15::TestIndicator::stdlib::onTick()   MODE_LOTSIZE           = 100000
M15::TestIndicator::stdlib::onTick()   MODE_TICKVALUE         = 1
M15::TestIndicator::stdlib::onTick()   MODE_TICKSIZE          = 0.0000'1
M15::TestIndicator::stdlib::onTick()   MODE_SWAPLONG          = -1.3
M15::TestIndicator::stdlib::onTick()   MODE_SWAPSHORT         = 0.5
M15::TestIndicator::stdlib::onTick()   MODE_STARTING          = 0
M15::TestIndicator::stdlib::onTick()   MODE_EXPIRATION        = 0
M15::TestIndicator::stdlib::onTick()   MODE_TRADEALLOWED      = 1
M15::TestIndicator::stdlib::onTick()   MODE_MINLOT            = 0.01
M15::TestIndicator::stdlib::onTick()   MODE_LOTSTEP           = 0.01
M15::TestIndicator::stdlib::onTick()   MODE_MAXLOT            = 2
M15::TestIndicator::stdlib::onTick()   MODE_SWAPTYPE          = 0
M15::TestIndicator::stdlib::onTick()   MODE_PROFITCALCMODE    = 0
M15::TestIndicator::stdlib::onTick()   MODE_MARGINCALCMODE    = 0
M15::TestIndicator::stdlib::onTick()   MODE_MARGININIT        = 0
M15::TestIndicator::stdlib::onTick()   MODE_MARGINMAINTENANCE = 0
M15::TestIndicator::stdlib::onTick()   MODE_MARGINHEDGED      = 50000
M15::TestIndicator::stdlib::onTick()   MODE_MARGINREQUIRED    = 259.73                   // error: value taken from online environment
M15::TestIndicator::stdlib::onTick()   MODE_FREEZELEVEL       = 0

hope that helps

 
paulepanke:

hope that helps


LOL,  yes it does,  thank you for sharing :-)
 
RaptorUK:
LOL,  yes it does,  thank you for sharing :-)


sorry i don't understant post above with this experiment, can you describe it in few words?
 
koskow:

sorry i don't understant post above with this experiment, can you describe it in few words?

There are 3 sections:

// EA in Strategy Tester

// Indicator in Strategy Tester via iCustom()

// Indicator in Strategy Tester standalone (attached to chart)

the contents of each section shows what works and what doesn't, for example Bid in the Indicator in Strategy Tester standalone (attached to a chart) section  

"Bid/Ask = 1.2983'9/1.2986'7                       // error: value taken from online environment

 
paulepanke:

hope that helps


It's worth adding to this that a Indicator in Strategy Tester standalone (attached to chart) will get the Order information not from the Strategy Tester but from the live terminal it is running on.