RicardoSantos

[STRATEGY][RS]Roulette Martingale V0

2311 просмотров
216
2311 8
a solid strategy all across the majors.
double the profits :p

WARNING: use at your own discretion.
Удалить из избранных скриптов Добавить в избранные скрипты
//@version=2
strategy(title='[STRATEGY][RS]Roulette Martingale V0', shorttitle='RM', overlay=false, pyramiding=0, initial_capital=100000, currency=currency.USD)
initial_trading_risk_vs_equity = input(0.1)
maximum_risk_ratio_of_equity = input(0.5)
take_profit_in_points = input(1000000)
stop_loss_in_points = input(1000000)

trade_session = input(title='Trade Session:', type=string, defval='0400-1500', confirm=false)
istradingsession = not na(time('1', trade_session))
bgcolor(istradingsession ? black : na, transp=50)

base_trade_size = strategy.equity * initial_trading_risk_vs_equity
direction = na(direction[1]) ? 1 : direction[1] == +1 and change(strategy.netprofit) < 0 ? -1 : direction[1] == -1 and change(strategy.netprofit) < 0 ? +1 : direction[1]

condition_buy_entry = change(istradingsession) > 0 and direction > 0 //and track_buy_trades[1] > 0
condition_sel_entry = change(istradingsession) > 0 and direction < 0 //and track_sel_trades[1] > 0

track_buy_trades = na(track_buy_trades[1]) ? 1 : change(condition_buy_entry) > 0 ? track_buy_trades[1] + 1 : track_sel_trades[1] > 0 ? 0 : track_buy_trades[1]
track_sel_trades = na(track_sel_trades[1]) ? 1 : change(condition_sel_entry) > 0 ? track_sel_trades[1] + 1 : track_buy_trades[1] > 0 ? 0 : track_sel_trades[1]
plot(track_buy_trades)
plot(0-track_sel_trades)

adjusted_trade_size = min(strategy.equity*maximum_risk_ratio_of_equity, base_trade_size * (track_buy_trades+track_sel_trades))
strategy.entry('buy', long=true, qty=adjusted_trade_size, when=condition_buy_entry)
strategy.entry('sel', long=false, qty=adjusted_trade_size, when=condition_sel_entry)
strategy.exit('exit buy', from_entry='buy', profit=take_profit_in_points, loss=stop_loss_in_points)
strategy.close_all(when = not istradingsession)
Hey @RicardoSantos I couldn't figure out how to make this strategy profitable when including realistic spread and commissions, 5 points and $7/Standard respectively. I played around with the setting for a while, but it always broke even (plus or minus a percent). Any ideas?
Ответить
Thank you Ricardo. A general question: Is there any way how to display the "The Total Bars" information? I do not see it in Performance report or anywhere else. For me it is an important information to assess profit/loss of particular strategy over time...
Ответить
open the trade list and see when the 1st trade was done you can get the time window from there.
Ответить
What are the entry points to trade based on?
Ответить
it enters when the session starts and it follows a direction untill a trade returns negative, setting direction to the opposite side after. this only opens 1 trade per day
Ответить
Oh, the old Martigale, the memories when I used Martigale in sports betting lol
Ответить
cristian.d cristian.d
Hm, looks interesting, thank you. I am amazed everytime of your work.
Ответить
thx, np. :p
Ответить
Домой Скринер акций Скринер форекс Скринер криптовалют Экономический календарь Шоу О проекте Особенности Цены Правила поведения Модераторы Решения для сайтов и брокеров Виджеты Графики TradingView для сайтов Легкая версия графиков Справочный центр Приведи друга Отзывы и предложения Блог и новости ЧаВо Wiki Твиттер
Профиль Настройка профиля Счёт и оплата Приведи друга Мои запросы в поддержку Справочный центр Опубликовано идей Подписчики Подписан Личные сообщения Чат Выйти